Class: Hungry::Menu

Inherits:
Resource show all
Defined in:
lib/hungry/menu.rb,
lib/hungry/menu/dish.rb,
lib/hungry/menu/option.rb,
lib/hungry/menu/category.rb

Defined Under Namespace

Classes: Category, Dish, Option

Instance Attribute Summary collapse

Attributes inherited from Resource

#attributes, #data_source, #resources

Instance Method Summary collapse

Methods inherited from Resource

all, belongs_to, #canonical_data_source, collection, each, find, first, get, has_many, #initialize, lazy_load, #reload

Constructor Details

This class inherits a constructor from Hungry::Resource

Instance Attribute Details

#attachmentObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def attachment
  @attachment
end

#categoriesObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def categories
  @categories
end

#created_atObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def created_at
  @created_at
end

#idObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def id
  @id
end

#nameObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def name
  @name
end

#pagesObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def pages
  @pages
end

#typeObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def type
  @type
end

#updated_atObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def updated_at
  @updated_at
end

#venueObject

Menu:



16
17
18
# File 'lib/hungry/menu.rb', line 16

def venue
  @venue
end

Instance Method Details

#download?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/hungry/menu.rb', line 30

def download?
  type == 'download'
end

#managed?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/hungry/menu.rb', line 26

def managed?
  type == 'managed' || (!download? && categories.present?)
end