Module: Waiter::DSL
- Included in:
- Menu
- Defined in:
- lib/waiter/dsl.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/waiter/dsl.rb', line 9
def method_missing(name, *args, &block)
return context.send(name, *args, &block) if context.respond_to?(name)
path = args.shift
options = args.
if path.is_a?(Hash) && !(path.key?(:controller) || path.key?(:action))
options, path = path, nil
end
options[:controllers] ||= []
add(name, path, options, &block)
return nil
end
|
Instance Method Details
#section(options = {}, &block) ⇒ Object
5
6
7
|
# File 'lib/waiter/dsl.rb', line 5
def section(options = {}, &block)
add_section(options, &block)
end
|