Class: Interview::Tab
- Includes:
- HasControls
- Defined in:
- lib/interview/tab.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#caption ⇒ Object
Returns the value of attribute caption.
Attributes included from HasControls
Attributes inherited from Control
Instance Method Summary collapse
Methods included from HasControls
#add_control, #add_controls, included, #initialize, #siblings
Methods inherited from Control
#ancestors, build, definition, #find_attribute, #find_attribute!, inherited, #initialize, #set_attributes, #set_defaults
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
6 7 8 |
# File 'lib/interview/tab.rb', line 6 def active @active end |
#caption ⇒ Object
Returns the value of attribute caption.
6 7 8 |
# File 'lib/interview/tab.rb', line 6 def caption @caption end |
Instance Method Details
#render ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/interview/tab.rb', line 8 def render html = Builder::XmlMarkup.new html_class = 'tab-pane' html_class += ' active' if @active html.div class: html_class, id: @caption do @controls.each do |control| html << control.render end end return html.target! end |