Class: SimpleNavigation::Configuration::Builder
- Inherits:
-
Object
- Object
- SimpleNavigation::Configuration::Builder
- Defined in:
- lib/simple_navigation.rb
Overview
Simple Navigation configuration builder
Defined Under Namespace
Classes: Navigation
Instance Attribute Summary collapse
-
#navigations ⇒ Object
Returns the value of attribute navigations.
-
#prefix ⇒ Object
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#build ⇒ Object
Render new navigation.
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
-
#navigation(name, options = {}) {|navigation| ... } ⇒ Object
Create a new navigation.
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
146 147 148 |
# File 'lib/simple_navigation.rb', line 146 def initialize self. = [] end |
Instance Attribute Details
#navigations ⇒ Object
Returns the value of attribute navigations.
144 145 146 |
# File 'lib/simple_navigation.rb', line 144 def @navigations end |
#prefix ⇒ Object
Returns the value of attribute prefix.
144 145 146 |
# File 'lib/simple_navigation.rb', line 144 def prefix @prefix end |
Instance Method Details
#build ⇒ Object
Render new navigation
159 160 161 |
# File 'lib/simple_navigation.rb', line 159 def build { :navigations => } end |
#navigation(name, options = {}) {|navigation| ... } ⇒ Object
Create a new navigation
151 152 153 154 155 156 |
# File 'lib/simple_navigation.rb', line 151 def (name, = {}, &block) .merge!(:i18n => false) unless .has_key?(:i18n) = Navigation.new(name, ) yield self. << .build end |