Class: Merrymenu::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/merrymenu/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfigure

Returns a new instance of Configure.



6
7
8
# File 'lib/merrymenu/builder.rb', line 6

def initialize
  @menus = {}
end

Instance Attribute Details

Returns the value of attribute menus.



4
5
6
# File 'lib/merrymenu/builder.rb', line 4

def menus
  @menus
end

Instance Method Details

#configure {|menu| ... } ⇒ Object

Yields:

  • (menu)


10
11
12
13
14
# File 'lib/merrymenu/builder.rb', line 10

def configure
  menu = Menu.new
  yield menu
  @menus[menu.name] = menu.build
end