Class: Tienda::NavigationManager::NavigationItem
- Inherits:
-
Object
- Object
- Tienda::NavigationManager::NavigationItem
- Defined in:
- lib/tienda/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.
54 55 56 |
# File 'lib/tienda/navigation_manager.rb', line 54 def active_if @active_if end |
#identifier ⇒ Object
Returns the value of attribute identifier.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def identifier @identifier end |
#link_options ⇒ Object
Returns the value of attribute link_options.
53 54 55 |
# File 'lib/tienda/navigation_manager.rb', line 53 def end |
#manager ⇒ Object
Returns the value of attribute manager.
50 51 52 |
# File 'lib/tienda/navigation_manager.rb', line 50 def manager @manager end |
#url(request = nil) ⇒ Object
Returns the value of attribute url.
52 53 54 |
# File 'lib/tienda/navigation_manager.rb', line 52 def url @url end |
Instance Method Details
#active?(request) ⇒ Boolean
66 67 68 69 70 71 72 |
# File 'lib/tienda/navigation_manager.rb', line 66 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
56 57 58 |
# File 'lib/tienda/navigation_manager.rb', line 56 def description I18n.translate("tienda.navigation.#{manager.identifier}.#{identifier}") end |