Class: Aerogel::Admin::Menu::Item
- Inherits:
-
Object
- Object
- Aerogel::Admin::Menu::Item
- Defined in:
- lib/aerogel/admin/menu.rb
Instance Attribute Summary collapse
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#label ⇒ Object
Returns the value of attribute label.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #human_label ⇒ Object
-
#initialize(url, opts = {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(url, opts = {}) ⇒ Item
Returns a new instance of Item.
18 19 20 21 22 23 |
# File 'lib/aerogel/admin/menu.rb', line 18 def initialize( url, opts = {} ) self.url = url self.icon = opts[:icon] self.label = opts[:label] || url self.priority = opts[:priority] || 50 end |
Instance Attribute Details
#icon ⇒ Object
Returns the value of attribute icon.
17 18 19 |
# File 'lib/aerogel/admin/menu.rb', line 17 def icon @icon end |
#label ⇒ Object
Returns the value of attribute label.
17 18 19 |
# File 'lib/aerogel/admin/menu.rb', line 17 def label @label end |
#priority ⇒ Object
Returns the value of attribute priority.
17 18 19 |
# File 'lib/aerogel/admin/menu.rb', line 17 def priority @priority end |
#url ⇒ Object
Returns the value of attribute url.
17 18 19 |
# File 'lib/aerogel/admin/menu.rb', line 17 def url @url end |
Class Method Details
Instance Method Details
#human_label ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/aerogel/admin/menu.rb', line 29 def human_label if label.is_a? Symbol I18n.t label else label.humanize end end |