Module: RateBeer

Defined in:
lib/ratebeer.rb,
lib/ratebeer/beer.rb,
lib/ratebeer/urls.rb,
lib/ratebeer/style.rb,
lib/ratebeer/region.rb,
lib/ratebeer/review.rb,
lib/ratebeer/search.rb,
lib/ratebeer/brewery.rb,
lib/ratebeer/country.rb,
lib/ratebeer/location.rb,
lib/ratebeer/scraping.rb,
lib/ratebeer/beer/alias.rb,
lib/ratebeer/brewery/beer_list.rb

Overview

RateBeer.com scraper

Scrapes required information on beers, breweries, ratings, etc. from the RateBeer.com beer database.

Defined Under Namespace

Modules: Beer, Brewery, Scraping, URLs Classes: Country, Location, Region, Review, Search, Style

Instance Method Summary collapse

Instance Method Details

#beer(id, name = nil) ⇒ RateBeer::Beer

Create new beer instance, using ID and name passed as arguments.

Parameters:

  • id (Integer, String)

    ID# of beer to retrieve

  • name (String) (defaults to: nil)

    Name of the beer to which ID# relates if known

Returns:



15
16
17
# File 'lib/ratebeer.rb', line 15

def beer(id, name = nil)
  Beer::Beer.new(id, name: name)
end

#brewery(id, name = nil) ⇒ RateBeer::Brewery

Create new brewery instance, using ID and name passed as arguments.

Parameters:

  • id (Integer, String)

    ID# of brewery to retrieve

  • name (String) (defaults to: nil)

    Name of the brewery to which ID# relates if known

Returns:



25
26
27
# File 'lib/ratebeer.rb', line 25

def brewery(id, name = nil)
  Brewery::Brewery.new(id, name: name)
end

#search(query) ⇒ Hash<Array>

Search for a particulary beer or brewery.

Parameters:

  • query (String)

    Search parameters to use

Returns:

  • (Hash<Array>)

    Hash containing Arrays containing RateBeer::Beer and RateBeer::Brewery instances matching search parameters



45
46
47
# File 'lib/ratebeer.rb', line 45

def search(query)
  Search.search(query)
end

#style(id, name = nil) ⇒ RateBeer::Style

Create new style instance, using ID and name passed as arguments.

Parameters:

  • id (Integer, String)

    ID# of style to retrieve

  • name (String) (defaults to: nil)

    Name of the style to which ID# relates if known

Returns:



35
36
37
# File 'lib/ratebeer.rb', line 35

def style(id, name = nil)
  Style.new(id, name: name)
end