Class: AMarmita::Meals::Base

Inherits:
ClientModule show all
Defined in:
lib/a_marmita/meals/base.rb

Instance Attribute Summary

Attributes inherited from ClientModule

#client

Instance Method Summary collapse

Methods inherited from ClientModule

#initialize

Constructor Details

This class inherits a constructor from AMarmita::ClientModule

Instance Method Details

#desserts(date = nil, week_number = nil) ⇒ Object



26
27
28
# File 'lib/a_marmita/meals/base.rb', line 26

def desserts(date = nil, week_number = nil)
  get_meals(DESSERT, date, week_number)
end

#main_courses(date = nil, week_number = nil) ⇒ Object



22
23
24
# File 'lib/a_marmita/meals/base.rb', line 22

def main_courses(date = nil, week_number = nil)
  get_meals(MAIN_COURSE, date, week_number)
end

#soups(date = nil, week_number = nil) ⇒ Object



18
19
20
# File 'lib/a_marmita/meals/base.rb', line 18

def soups(date = nil, week_number = nil)
  get_meals(SOUP, date, week_number)
end

#today_menuObject



10
11
12
13
14
15
16
# File 'lib/a_marmita/meals/base.rb', line 10

def today_menu
  page = get_page "http://www.amarmita.com/ementa.php"
  
  content_rows = page.parser.css('#conteudo > table > tr')
  
  { available_days: parse_links(page), list: parse_meals(content_rows) }
end