Class: Interview::CollapseContainer
- Defined in:
- lib/interview/controls/collapse_container.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#image ⇒ Object
Returns the value of attribute image.
Attributes inherited from Control
Instance Method Summary collapse
Methods inherited from Control
#ancestors, #build_child, #build_with_params, #find_attribute, #find_attribute!, #initialize, #set_attributes, #set_defaults
Constructor Details
This class inherits a constructor from Interview::Control
Instance Attribute Details
#caption ⇒ Object
Returns the value of attribute caption.
4 5 6 |
# File 'lib/interview/controls/collapse_container.rb', line 4 def @caption end |
#image ⇒ Object
Returns the value of attribute image.
4 5 6 |
# File 'lib/interview/controls/collapse_container.rb', line 4 def image @image end |
Instance Method Details
#build(b) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/interview/controls/collapse_container.rb', line 6 def build(b) new_id = Time.now.to_f.to_s.delete('.') b.link image: @image, caption: @caption, url: '#', html_class: 'collapse_link', html_options: { data: { toogle: 'collapse', target: "##{new_id}" } } b.section html_class: 'panel-collapse collapse', html_options: { id: new_id } do yield if block_given? end end |