Class: TagBuilder::TagInCd
- Inherits:
-
Object
- Object
- TagBuilder::TagInCd
- Includes:
- TagMixin
- Defined in:
- lib/tag_builder/tag_in_cd.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#negativos ⇒ Object
readonly
Returns the value of attribute negativos.
-
#positivos ⇒ Object
readonly
Returns the value of attribute positivos.
-
#predeterminado ⇒ Object
Returns the value of attribute predeterminado.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #boton_negativo_html(ru) ⇒ Object
- #boton_positivo_html(ru) ⇒ Object
- #button_change_html(url_t, glyphicon_class, number) ⇒ Object
- #button_same_html(btn_class, glyphicon_class, number) ⇒ Object
-
#initialize(votos) ⇒ TagInCd
constructor
A new instance of TagInCd.
Methods included from TagMixin
#botones_html, #initialize_common, #mostrar, #resultado_usuario, #sin_votos?
Constructor Details
#initialize(votos) ⇒ TagInCd
Returns a new instance of TagInCd
35 36 37 38 39 40 |
# File 'lib/tag_builder/tag_in_cd.rb', line 35 def initialize(votos) initialize_common(votos) @cd_id=votos[0][:canonical_document_id] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id
33 34 35 |
# File 'lib/tag_builder/tag_in_cd.rb', line 33 def id @id end |
#negativos ⇒ Object (readonly)
Returns the value of attribute negativos
33 34 35 |
# File 'lib/tag_builder/tag_in_cd.rb', line 33 def negativos @negativos end |
#positivos ⇒ Object (readonly)
Returns the value of attribute positivos
33 34 35 |
# File 'lib/tag_builder/tag_in_cd.rb', line 33 def positivos @positivos end |
#predeterminado ⇒ Object
Returns the value of attribute predeterminado
34 35 36 |
# File 'lib/tag_builder/tag_in_cd.rb', line 34 def predeterminado @predeterminado end |
#text ⇒ Object (readonly)
Returns the value of attribute text
33 34 35 |
# File 'lib/tag_builder/tag_in_cd.rb', line 33 def text @text end |
Instance Method Details
#boton_negativo_html(ru) ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/tag_builder/tag_in_cd.rb', line 57 def boton_negativo_html(ru) if ru.nil? or ru[:decision]=='yes' url_t="/tags/cd/#{@cd_id}/rs/#{@rs_id}/reject_tag" (url_t, "minus",negativos) else ("danger","minux",negativos) end end |
#boton_positivo_html(ru) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/tag_builder/tag_in_cd.rb', line 49 def boton_positivo_html(ru) if ru.nil? or ru[:decision]=='no' url_t="/tags/cd/#{@cd_id}/rs/#{@rs_id}/approve_tag" (url_t, "plus",positivos) else ("success","plus",positivos) end end |
#button_change_html(url_t, glyphicon_class, number) ⇒ Object
42 43 44 |
# File 'lib/tag_builder/tag_in_cd.rb', line 42 def (url_t, glyphicon_class,number) "<button class='btn btn-default boton_accion_tag_cd_rs' cd-pk='#{@cd_id}' rs-pk='#{@rs_id}' tag-pk='#{@tag_id}' data-url='#{url_t}'><span class='glyphicon glyphicon-#{glyphicon_class}'></span> <span class='badge '>#{number}</span></button>" end |
#button_same_html(btn_class, glyphicon_class, number) ⇒ Object
45 46 47 |
# File 'lib/tag_builder/tag_in_cd.rb', line 45 def (btn_class, glyphicon_class, number) "<button class='btn btn-#{btn_class}'><span class='glyphicon glyphicon-#{glyphicon_class}'></span> <span class='badge '>#{number}</span></button>" end |