Class: SemanticNavigation::Core::Leaf
- 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::ConditionMethods
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.
10 11 12 13 |
# File 'lib/semantic_navigation/core/leaf.rb', line 10 def initialize(, level) @link_html = {} super , level end |
Instance Attribute Details
#link_classes ⇒ Object
Returns the value of attribute link_classes.
8 9 10 |
# File 'lib/semantic_navigation/core/leaf.rb', line 8 def link_classes @link_classes end |
#link_html ⇒ Object
Returns the value of attribute link_html.
8 9 10 |
# File 'lib/semantic_navigation/core/leaf.rb', line 8 def link_html @link_html end |
Instance Method Details
#mark_active ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/semantic_navigation/core/leaf.rb', line 15 def mark_active if @url @active = urls.map{|u| current_page?(u) rescue false}.reduce(:"|") else @active = false end end |