Class: Untappd::Beer

Inherits:
Base
  • Object
show all
Defined in:
lib/untappd/beer.rb

Class Method Summary collapse

Methods inherited from Base

auth_options, response_to_mash

Class Method Details

.feed(beer_id, options = {}) ⇒ Object

options:

  • min_id (int, optional) - The numeric ID of the most recent check-in. This is provided to

you in the next_query attribute.

  • max_id (int, optional) - The checkin ID that you want the results to start with

  • limit (int, optional) - The number of results to return, maximum of 50, default is 25



8
9
10
11
# File 'lib/untappd/beer.rb', line 8

def self.feed(beer_id, options={})
  options.merge!(auth_options)
  response = response_to_mash get("/beer/checkins/#{beer_id}", :query => options)
end

.info(beer_id, options = {}) ⇒ Object



13
14
15
16
# File 'lib/untappd/beer.rb', line 13

def self.info(beer_id, options={})
  options.merge!(auth_options)
  response_to_mash get("/beer/info/#{beer_id}", :query => options)
end

.search(q, options = {}) ⇒ Object

options:

  • sort (optional): “count” or “name” (default) - This can let you choose if you want the

results to be returned in Alphabetical order (name) or by checkin count (count). By default the search returns all values in Alphabetical order.



22
23
24
25
26
# File 'lib/untappd/beer.rb', line 22

def self.search(q, options={})
  options.merge!(auth_options)
  options.merge!({ :q => q })
  response_to_mash get("/search/beer/", :query => options)
end


28
29
30
# File 'lib/untappd/beer.rb', line 28

def self.trending
  response_to_mash get("/beer/trending", :query => auth_options)
end