Class: SemanticNavigation::Core::Leaf
- Includes:
- MixIn::NameMethods, MixIn::UrlMethods
- Defined in:
- lib/semantic_navigation/core/leaf.rb
Instance Attribute Summary collapse
-
#link_classes ⇒ Object
Returns the value of attribute link_classes.
-
#link_html ⇒ Object
Returns the value of attribute link_html.
Attributes inherited from Base
#active, #classes, #html, #id, #level, #render_if
Instance Method Summary collapse
-
#initialize(options, level) ⇒ Leaf
constructor
A new instance of Leaf.
- #mark_active ⇒ Object
Methods included from MixIn::NameMethods
Methods included from MixIn::UrlMethods
Methods inherited from Base
Constructor Details
#initialize(options, level) ⇒ Leaf
Returns a new instance of Leaf.
9 10 11 12 |
# File 'lib/semantic_navigation/core/leaf.rb', line 9 def initialize(, level) @link_html = {} super , level end |
Instance Attribute Details
#link_classes ⇒ Object
Returns the value of attribute link_classes.
7 8 9 |
# File 'lib/semantic_navigation/core/leaf.rb', line 7 def link_classes @link_classes end |
#link_html ⇒ Object
Returns the value of attribute link_html.
7 8 9 |
# File 'lib/semantic_navigation/core/leaf.rb', line 7 def link_html @link_html end |
Instance Method Details
#mark_active ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/semantic_navigation/core/leaf.rb', line 14 def mark_active if @url @active = urls.map{|u| current_page?(u) rescue false}.reduce(:"|") else @active = false end end |