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 +11 -4
- data/lib/drink-socially/api.rb +1 -1
- data/lib/drink-socially/version.rb +1 -1
- metadata +1 -1
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
|
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
|
-
|
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
|
-
|
59
|
+
### NRB::Untappd::API::Object
|
54
60
|
|
61
|
+
Responses from the API are marshalled into `NRB::Untappd::API::Object` instances.
|
data/lib/drink-socially/api.rb
CHANGED