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.
8 9 10 11 12 13 14 |
# File 'lib/sunrise/config/navigation_item.rb', line 8 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.
6 7 8 |
# File 'lib/sunrise/config/navigation_item.rb', line 6 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/sunrise/config/navigation_item.rb', line 6 def url @url end |
Instance Method Details
#html_options ⇒ Object
20 21 22 |
# File 'lib/sunrise/config/navigation_item.rb', line 20 def @options.nil? ? {} : @options.dup end |
#title ⇒ Object
16 17 18 |
# File 'lib/sunrise/config/navigation_item.rb', line 16 def title @title ||= I18n.t(@name, scope: [:manage, :menu, @scope]) end |