Class: SemanticNavigation::Core::Node
- Inherits:
-
Navigation
- Object
- Base
- Navigation
- SemanticNavigation::Core::Node
- Includes:
- MixIn::NameMethods, MixIn::UrlMethods
- Defined in:
- lib/semantic_navigation/core/node.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.
-
#node_classes ⇒ Object
Returns the value of attribute node_classes.
-
#node_html ⇒ Object
Returns the value of attribute node_html.
Attributes inherited from Navigation
Attributes inherited from Base
#active, #classes, #html, #id, #level, #render_if
Instance Method Summary collapse
-
#initialize(options, level) ⇒ Node
constructor
A new instance of Node.
- #mark_active ⇒ Object
Methods included from MixIn::NameMethods
Methods included from MixIn::UrlMethods
Methods inherited from Navigation
#divider, #header, #item, #method_missing, #scope
Methods inherited from Base
Constructor Details
#initialize(options, level) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 15 |
# File 'lib/semantic_navigation/core/node.rb', line 10 def initialize(, level) @url = [] @link_html = {} @node_html = {} super , level end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SemanticNavigation::Core::Navigation
Instance Attribute Details
#link_classes ⇒ Object
Returns the value of attribute link_classes.
7 8 9 |
# File 'lib/semantic_navigation/core/node.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/node.rb', line 7 def link_html @link_html end |
#node_classes ⇒ Object
Returns the value of attribute node_classes.
7 8 9 |
# File 'lib/semantic_navigation/core/node.rb', line 7 def node_classes @node_classes end |
#node_html ⇒ Object
Returns the value of attribute node_html.
7 8 9 |
# File 'lib/semantic_navigation/core/node.rb', line 7 def node_html @node_html end |
Instance Method Details
#mark_active ⇒ Object
17 18 19 20 21 |
# File 'lib/semantic_navigation/core/node.rb', line 17 def mark_active @sub_elements.each{|element| element.mark_active} @active = urls.map{|u| current_page?(u) rescue false}.reduce(:"|") @active |= !@sub_elements.find{|element| element.active}.nil? end |