Class: Menumatic::Navigation::Item::Link
- Defined in:
- lib/menumatic/navigation/item/link.rb
Instance Attribute Summary collapse
-
#active_paths ⇒ Object
Returns the value of attribute active_paths.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#label ⇒ Object
Returns the value of attribute label.
Attributes inherited from Base
#html_options, #items, #wrapper_options
Instance Method Summary collapse
-
#initialize(*args) ⇒ Link
constructor
A new instance of Link.
Methods inherited from Base
Methods included from Navigators
Methods included from Renderers
#count_active_descendants, #depth_count, #has_active_descendant?, #is_active?, #levels_to_i, #on_valid_level?, #paths_match?, #render, #render_sitemap
Constructor Details
#initialize(*args) ⇒ Link
Returns a new instance of Link.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/menumatic/navigation/item/link.rb', line 6 def initialize(*args) super self.label = args[0] self.destination = args[1] if args.length > 2 = args[2] if [:active_on] self.active_paths = [:active_on] .delete(:active_on) end end self.active_paths ||= [] end |
Instance Attribute Details
#active_paths ⇒ Object
Returns the value of attribute active_paths.
5 6 7 |
# File 'lib/menumatic/navigation/item/link.rb', line 5 def active_paths @active_paths end |
#destination ⇒ Object
Returns the value of attribute destination.
5 6 7 |
# File 'lib/menumatic/navigation/item/link.rb', line 5 def destination @destination end |
#label ⇒ Object
Returns the value of attribute label.
5 6 7 |
# File 'lib/menumatic/navigation/item/link.rb', line 5 def label @label end |