drink-socially 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,9 +20,13 @@ require 'drink-socially'
20
20
  # Per-user access token taken from OAuth
21
21
  brundage = NRB::Untappd::API.new access_token: '7A23A8BEER81D2580E&CEFC405C60693AC476AA'
22
22
 
23
- new_republic = brundage.brewery_info 8767
23
+ new_republic = brundage.brewery_info brewery_id: 8767
24
24
  => #<Hashie::Mash beer_count=13 beer_list=....
25
25
 
26
+ new_republic.attributes.sort
27
+ => [:beer_count, :beer_list, :brewery_description, :brewery_id, :brewery_in_production, :brewery_label, :brewery_name, :brewery_type, :checkins, :claimed_status, :contact, :country_name, :location, :media, :rating, :stats]
28
+
29
+
26
30
  new_republic.brewery_name
27
31
  => "New Republic Brewing Company"
28
32
 
@@ -41,14 +45,17 @@ new_republic_app = NRB::Untappd::API.new client_id: '645c10bc59f30e34d6fd265cfde
41
45
 
42
46
  `new` takes a user access token or a application id and secret. Once you have an instance of the API you can make calls on behalf of the user or application.
43
47
 
44
- The Untappd api enforces a rate limit per token. After the first call you can ask your object the current limit with the `rate_limit` call.
48
+ The Untappd api enforces a rate limit per token. After the first call you can ask your object the current limit with `rate_limit`.
45
49
 
46
50
  ```
47
51
  brundage.rate_limit
48
52
  => @rate_limit= #<NRB::Untappd::API::RateLimit:0x930af6c @limit="100", @remaining="99">>
49
53
  ```
50
54
 
51
- All API calls return an `NRB::Untappd::API::Response` object. You can access the full response object with the `last_response` method.
55
+ API calls return an `NRB::Untappd::API::Object`, which is mostly a Hashie::Mash.
56
+
57
+ Documentation for the API calls are detailed [in the wiki](drink-socially/wiki/api_calls). Also have a look at the [Untappd v4 API documentation](http://untappd.com/api/docs/v4) for details.
52
58
 
53
- Full documentation for the API calls are detailed [in the wiki](drink-socially/wiki/api_calls). Also have a look at the [Untappd v4 API documentation](http://untappd.com/api/docs/v4) for details.
59
+ ### NRB::Untappd::API::Object
54
60
 
61
+ Responses from the API are marshalled into `NRB::Untappd::API::Object` instances.
@@ -105,7 +105,7 @@ module NRB
105
105
 
106
106
 
107
107
  def get_config(endpoint)
108
- config = @endpoints[endpoint]
108
+ config = @credential.merge(@endpoints[endpoint])
109
109
  return unless config
110
110
  config[:verb] ||= :get
111
111
  config
@@ -1,6 +1,6 @@
1
1
  module NRB
2
2
  module Untappd
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  def self.version
5
5
  VERSION
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drink-socially
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: