Class: Sunrise::Config::NavigationItem
- Inherits:
-
Object
- Object
- Sunrise::Config::NavigationItem
- Defined in:
- lib/sunrise/config/navigation_item.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #html_options ⇒ Object
-
#initialize(name, url, scope = "items", options = {}) ⇒ NavigationItem
constructor
A new instance of NavigationItem.
- #title ⇒ Object
Constructor Details
#initialize(name, url, scope = "items", options = {}) ⇒ NavigationItem
Returns a new instance of NavigationItem.
6 7 8 9 10 11 12 |
# File 'lib/sunrise/config/navigation_item.rb', line 6 def initialize(name, url, scope = "items", = {}) @name = name @scope = scope @url = url @title = .delete(:title) @options = end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/sunrise/config/navigation_item.rb', line 4 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
4 5 6 |
# File 'lib/sunrise/config/navigation_item.rb', line 4 def url @url end |
Instance Method Details
#html_options ⇒ Object
18 19 20 |
# File 'lib/sunrise/config/navigation_item.rb', line 18 def @options.nil? ? {} : @options.dup end |
#title ⇒ Object
14 15 16 |
# File 'lib/sunrise/config/navigation_item.rb', line 14 def title @title ||= I18n.t(@name, :scope => [:manage, :menu, @scope]) end |