Class: Interview::Glyphicon
- Includes:
- HasHtmlOptions
- Defined in:
- lib/interview/controls/glyphicon.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
Returns the value of attribute image.
Attributes included from HasHtmlOptions
Attributes inherited from Control
Instance Method Summary collapse
Methods included from HasHtmlOptions
Methods inherited from Control
#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults
Instance Attribute Details
#image ⇒ Object
Returns the value of attribute image.
6 7 8 |
# File 'lib/interview/controls/glyphicon.rb', line 6 def image @image end |
Instance Method Details
#build(b) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/interview/controls/glyphicon.rb', line 8 def build(b) html_class = @html_class if @image == 'caret' html_class << 'caret' else html_class += ["glyphicon", "glyphicon-#{@image}"] end b.section style: 'span', html_class: html_class, html_options: @html_options end |