Class: TabBuilder::TabPresenter
- Inherits:
-
Object
- Object
- TabBuilder::TabPresenter
- Defined in:
- app/classes/tab_builder/tab_presenter.rb
Instance Attribute Summary collapse
-
#tab ⇒ Object
readonly
Returns the value of attribute tab.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(template, tab) ⇒ TabPresenter
constructor
A new instance of TabPresenter.
- #title ⇒ Object
Constructor Details
#initialize(template, tab) ⇒ TabPresenter
Returns a new instance of TabPresenter.
6 7 8 9 |
# File 'app/classes/tab_builder/tab_presenter.rb', line 6 def initialize(template, tab) @tab = tab @template = template end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object (private)
42 43 44 45 |
# File 'app/classes/tab_builder/tab_presenter.rb', line 42 def method_missing(*args, &block) return @template.send(*args, &block) if @template.respond_to?(args.first) super end |
Instance Attribute Details
#tab ⇒ Object (readonly)
Returns the value of attribute tab.
3 4 5 |
# File 'app/classes/tab_builder/tab_presenter.rb', line 3 def tab @tab end |
Instance Method Details
#classes ⇒ Object
11 12 13 |
# File 'app/classes/tab_builder/tab_presenter.rb', line 11 def classes (current? ? %w(tab current) : %w(tab)).join(" ") end |
#title ⇒ Object
15 16 17 |
# File 'app/classes/tab_builder/tab_presenter.rb', line 15 def title tab.tooltip ? tooltip : label end |