Class: Waiter::Menu::ItemList

Inherits:
Array
  • Object
show all
Defined in:
lib/waiter/menu/item_list.rb

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object



9
10
11
12
# File 'lib/waiter/menu/item_list.rb', line 9

def [](index)
  return detect{ |item| item.name == index } if index.is_a? Symbol
  super
end

#include?(other) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/waiter/menu/item_list.rb', line 4

def include?(other)
  return map(&:name).include?(other) if other.is_a? Symbol
  super
end

#namesObject



14
15
16
# File 'lib/waiter/menu/item_list.rb', line 14

def names
  map(&:name)
end