Class: SemanticNavigation::Core::Navigation
- Includes:
- MixIn::DslMethods
- Defined in:
- lib/semantic_navigation/core/navigation.rb
Instance Attribute Summary collapse
-
#sub_elements ⇒ Object
Returns the value of attribute sub_elements.
Attributes inherited from Base
#active, #classes, #html, #id, #level, #render_if
Instance Method Summary collapse
-
#initialize(options) ⇒ Navigation
constructor
A new instance of Navigation.
- #mark_active ⇒ Object
Methods included from MixIn::DslMethods
#divider, #header, #item, #method_missing, #scope
Methods inherited from Base
Constructor Details
#initialize(options) ⇒ Navigation
Returns a new instance of Navigation.
8 9 10 11 12 |
# File 'lib/semantic_navigation/core/navigation.rb', line 8 def initialize() @sub_elements = [] = {} super , 0 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SemanticNavigation::Core::MixIn::DslMethods
Instance Attribute Details
#sub_elements ⇒ Object
Returns the value of attribute sub_elements.
6 7 8 |
# File 'lib/semantic_navigation/core/navigation.rb', line 6 def sub_elements @sub_elements end |
Instance Method Details
#mark_active ⇒ Object
14 15 16 17 18 19 |
# File 'lib/semantic_navigation/core/navigation.rb', line 14 def mark_active @sub_elements.each do |element| element.mark_active end @active = !@sub_elements.find{|element| element.active}.nil? end |