Class: Waiter::Menu::Drawer
- Inherits:
-
Object
- Object
- Waiter::Menu::Drawer
- Defined in:
- lib/waiter/menu/drawer.rb
Overview
Outputs a Menu into HTML
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#menu ⇒ Object
readonly
Returns the value of attribute menu.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(menu, context) ⇒ Drawer
constructor
A new instance of Drawer.
Constructor Details
#initialize(menu, context) ⇒ Drawer
Returns a new instance of Drawer.
11 12 13 14 15 |
# File 'lib/waiter/menu/drawer.rb', line 11 def initialize(, context) # context is a Controller binding, which allows the ActionView helpers to work in the correct context @context = context @menu = end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/waiter/menu/drawer.rb', line 7 def context @context end |
#menu ⇒ Object (readonly)
Returns the value of attribute menu.
7 8 9 |
# File 'lib/waiter/menu/drawer.rb', line 7 def @menu end |
Instance Method Details
#draw ⇒ Object
17 18 19 |
# File 'lib/waiter/menu/drawer.rb', line 17 def draw render partial: 'waiter/menu_bar', locals: { menu: } end |