Class: RailsBootstrapHelpers::Renderers::TabbableRenderer
- Defined in:
- lib/rails-bootstrap-helpers/renderers/tabbable_renderer.rb
Defined Under Namespace
Classes: Pane, Tab, TabContext
Instance Attribute Summary
Attributes inherited from Renderer
Instance Method Summary collapse
- #add_pane(block, options) ⇒ Object
- #add_tab(text, options) ⇒ Object
-
#initialize(template, *args, &block) ⇒ TabbableRenderer
constructor
A new instance of TabbableRenderer.
- #render ⇒ Object
Methods inherited from Renderer
Constructor Details
#initialize(template, *args, &block) ⇒ TabbableRenderer
Returns a new instance of TabbableRenderer.
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/rails-bootstrap-helpers/renderers/tabbable_renderer.rb', line 3 def initialize (template, *args, &block) super template @args = args || [] @block = block @options = {} @tabs = [] @panes = [] @last_id = 0 @ids = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class RailsBootstrapHelpers::Renderers::Renderer
Instance Method Details
#add_pane(block, options) ⇒ Object
26 27 28 |
# File 'lib/rails-bootstrap-helpers/renderers/tabbable_renderer.rb', line 26 def add_pane (block, ) @panes << Pane.new(block, ) end |
#add_tab(text, options) ⇒ Object
22 23 24 |
# File 'lib/rails-bootstrap-helpers/renderers/tabbable_renderer.rb', line 22 def add_tab (text, ) @tabs << Tab.new(text, ) end |
#render ⇒ Object
16 17 18 19 20 |
# File 'lib/rails-bootstrap-helpers/renderers/tabbable_renderer.rb', line 16 def render befor_block block.call TabContext.new(self) after_block end |