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.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#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.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def active_if @active_if end |
#icon ⇒ Object
Returns the value of attribute icon.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def icon @icon 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.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def @link_options end |
#manager ⇒ Object
Returns the value of attribute manager.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def manager @manager end |
#url(request = nil) ⇒ Object
Returns the value of attribute url.
51 52 53 |
# File 'lib/tienda/navigation_manager.rb', line 51 def url @url end |
Instance Method Details
#active?(request) ⇒ Boolean
63 64 65 66 67 68 69 |
# File 'lib/tienda/navigation_manager.rb', line 63 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
53 54 55 |
# File 'lib/tienda/navigation_manager.rb', line 53 def description I18n.translate("tienda.navigation.#{manager.identifier}.#{identifier}") end |