Class: Menumatic::Navigation::Item::Link

Inherits:
Base
  • Object
show all
Defined in:
lib/menumatic/navigation/item/link.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#html_options, #items, #wrapper_options

Instance Method Summary collapse

Methods inherited from Base

#is_group?, #is_link?

Methods included from Navigators

#group, #navigate_to

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
    options = args[2]

    if options[:active_on]
      self.active_paths = options[:active_on]
      options.delete(:active_on)
    end
  end
  self.active_paths ||= []
end

Instance Attribute Details

#active_pathsObject

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

#destinationObject

Returns the value of attribute destination.



5
6
7
# File 'lib/menumatic/navigation/item/link.rb', line 5

def destination
  @destination
end

#labelObject

Returns the value of attribute label.



5
6
7
# File 'lib/menumatic/navigation/item/link.rb', line 5

def label
  @label
end