Class: Navigation::Builder
Overview
responsible for the initial menu building/configuration
Ex (config/initializers/navigation.rb):
RPH::Navigation::Builder.config do |navigation|
navigation.define :primary do |menu|
...
end
end
Class Method Summary collapse
Instance Method Summary collapse
-
#define(*args) {|Menu.new(normalize(name), options)| ... } ⇒ Object
accepts a name/key, and yields a Menu instance to the block.
Methods inherited from Base
Class Method Details
.config {|self.new| ... } ⇒ Object
12 13 14 15 |
# File 'lib/navigation/builder.rb', line 12 def self.config # gives a Builder instance to the block yield self.new end |
Instance Method Details
#define(*args) {|Menu.new(normalize(name), options)| ... } ⇒ Object
accepts a name/key, and yields a Menu instance to the block
19 20 21 22 23 24 |
# File 'lib/navigation/builder.rb', line 19 def define(*args) name, = args.first, args. raise InvalidMenuDefinition, InvalidMenuDefinition. if name.blank? yield Menu.new(normalize(name), ) end |