Class: Waiter::Menu::Section
Instance Attribute Summary
Attributes inherited from Item
#name, #options, #parent, #path, #submenu
Instance Method Summary collapse
-
#initialize(parent, options = {}, &block) ⇒ Section
constructor
A new instance of Section.
- #items(sorted = false) ⇒ Object
- #section? ⇒ Boolean
Methods inherited from Item
#[], #controller, #controllers, #inspect, #item_title, #menu_title, #selected?, #submenu?
Constructor Details
#initialize(parent, options = {}, &block) ⇒ Section
Returns a new instance of Section.
6 7 8 |
# File 'lib/waiter/menu/section.rb', line 6 def initialize(parent, = {}, &block) super(parent, nil, nil, , &block) end |
Instance Method Details
#items(sorted = false) ⇒ Object
14 15 16 17 |
# File 'lib/waiter/menu/section.rb', line 14 def items(sorted = false) return super() unless sorted ItemList.new(super(), .slice(:sort, :reverse)) end |
#section? ⇒ Boolean
10 11 12 |
# File 'lib/waiter/menu/section.rb', line 10 def section? true end |