Module: Untappd::Client::Brewery

Included in:
Untappd::Client
Defined in:
lib/untappd-api/client/brewery.rb

Instance Method Summary collapse

Instance Method Details

#brewery(id) ⇒ Hashie::Mash

Returns info for the specified brewery.

Examples:

Retrieve brewery with ID 399.

Untappd.brewery(399)

Parameters:

  • id (String, Integer)

    The ID of the brewery.

Returns:

  • (Hashie::Mash)

    The requested brewery.



28
29
30
31
# File 'lib/untappd-api/client/brewery.rb', line 28

def brewery(id)
  options = { :brewery_id => id }
  get('/brewery_info', options)
end

#brewery_feed(id, options = {}) ⇒ Array

Returns the feed for the specified brewery.

Examples:

Retrieve the feed for brewery with ID 399.

Untappd.brewery_feed(399)

Parameters:

  • id (String, Integer)

    The ID of the brewery.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :since (String, Integer)

    The ID of the last recent check-in.

  • :offset (String, Integer)

    The offset you would like the dataset to begin with.

Returns:

  • (Array)

    The requested brewery feed.



15
16
17
18
# File 'lib/untappd-api/client/brewery.rb', line 15

def brewery_feed(id, options={})
  options.merge!(:brewery_id => id)
  get('/brewery_checkins', options)
end

#brewery_search(query, options = {}) ⇒ Array

Search breweries with the specified query.

Examples:

Search breweries for “Bell’s”.

Untappd.brewery_search("Bell's")

Parameters:

  • query (String)

    The term that you want to search.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :offset (String, Integer)

    The offset you would like the dataset to begin with.

Returns:

  • (Array)

    The search results.



42
43
44
45
# File 'lib/untappd-api/client/brewery.rb', line 42

def brewery_search(query, options={})
  options.merge!(:q => query)
  get('/brewery_search', options)
end