Class: Aerogel::Admin::TabsBuilder::Tab
- Inherits:
-
Object
- Object
- Aerogel::Admin::TabsBuilder::Tab
- Defined in:
- lib/aerogel/admin/tabs_builder.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#label ⇒ Object
Returns the value of attribute label.
-
#options ⇒ Object
Returns the value of attribute options.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #human_label ⇒ Object
-
#initialize(url, options = {}, &block) ⇒ Tab
constructor
A new instance of Tab.
Constructor Details
#initialize(url, options = {}, &block) ⇒ Tab
Returns a new instance of Tab.
46 47 48 49 50 51 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 46 def initialize( url, = {}, &block ) self.url = url self. = self.label = self.[:label] || self.url self.block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
44 45 46 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 44 def block @block end |
#label ⇒ Object
Returns the value of attribute label.
44 45 46 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 44 def label @label end |
#options ⇒ Object
Returns the value of attribute options.
44 45 46 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 44 def @options end |
#url ⇒ Object
Returns the value of attribute url.
44 45 46 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 44 def url @url end |
Instance Method Details
#human_label ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/aerogel/admin/tabs_builder.rb', line 53 def human_label if label.is_a? String label elsif label.is_a? Symbol I18n.t label else label.humanize end end |