Class: BeerBash::BeerMenus::Scraper

Inherits:
Object
  • Object
show all
Defined in:
lib/beer_bash/beer_menus.rb

Constant Summary collapse

BASE_URL =
'http://www.beermenus.com'

Instance Method Summary collapse

Instance Method Details

#places(name) ⇒ Object



36
37
38
39
40
# File 'lib/beer_bash/beer_menus.rb', line 36

def places(name)
  page = scrape(places_url(name))
  links = page.links_with(href: %r"/places/\d+-") # like /places/12-some-place
  links.collect {|link| Place.new(link.to_s, link.href)}
end

#taps(place_path) ⇒ Object



42
43
44
45
# File 'lib/beer_bash/beer_menus.rb', line 42

def taps(place_path)
  page = scrape(taps_url(place_path))
  TapList.new(find_updated(page), find_taps(page))
end