Class: KktShoppe::NavigationManager::NavigationItem
- Inherits:
-
Object
- Object
- KktShoppe::NavigationManager::NavigationItem
- Defined in:
- lib/kkt_shoppe/navigation_manager.rb
Instance Attribute Summary collapse
-
#active_if ⇒ Object
Returns the value of attribute active_if.
-
#identifier ⇒ Object
Returns the value of attribute identifier.
-
#link_options ⇒ Object
Returns the value of attribute link_options.
-
#manager ⇒ Object
Returns the value of attribute manager.
-
#url(request = nil) ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
Instance Attribute Details
#active_if ⇒ Object
Returns the value of attribute active_if.
55 56 57 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 55 def active_if @active_if end |
#identifier ⇒ Object
Returns the value of attribute identifier.
52 53 54 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 52 def identifier @identifier end |
#link_options ⇒ Object
Returns the value of attribute link_options.
54 55 56 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 54 def @link_options end |
#manager ⇒ Object
Returns the value of attribute manager.
51 52 53 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 51 def manager @manager end |
#url(request = nil) ⇒ Object
Returns the value of attribute url.
53 54 55 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 53 def url @url end |
Instance Method Details
#active?(request) ⇒ Boolean
67 68 69 70 71 72 73 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 67 def active?(request) if active_if.is_a?(Proc) request.instance_eval(&active_if) == true elsif active_nav_var = request.instance_variable_get('@active_nav') active_nav_var.to_s == identifier end end |
#description ⇒ Object
57 58 59 |
# File 'lib/kkt_shoppe/navigation_manager.rb', line 57 def description I18n.translate("kkt_shoppe.navigation.#{manager.identifier}.#{identifier}") end |