john-mayer 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,7 +6,7 @@ It's a Foursquare API wrapper.
6
6
 
7
7
  Get a foursquare:
8
8
 
9
- foursquare = Foursquare.new("ACCESS_TOKEN")
9
+ foursquare = Foursquare::Base.new("ACCESS_TOKEN")
10
10
 
11
11
  Find a user:
12
12
 
@@ -8,6 +8,11 @@ module Foursquare
8
8
  @json["id"]
9
9
  end
10
10
 
11
+ def fetch
12
+ @json = @foursquare.get("checkins/#{id}")["checkin"]
13
+ self
14
+ end
15
+
11
16
  def shout
12
17
  @json["shout"]
13
18
  end
@@ -25,6 +30,8 @@ module Foursquare
25
30
  end
26
31
 
27
32
  def user(full=false)
33
+ fetch unless @json["user"]
34
+
28
35
  if full
29
36
  @foursquare.users.find(@json["user"]["id"])
30
37
  else
@@ -7,5 +7,17 @@ module Foursquare
7
7
  def find(id)
8
8
  Foursquare::Checkin.new(@foursquare, @foursquare.get("checkins/#{id}")["checkin"])
9
9
  end
10
+
11
+ def recent(options={})
12
+ @foursquare.get("checkins/recent", options)["recent"].map do |json|
13
+ Foursquare::Checkin.new(@foursquare, json)
14
+ end
15
+ end
16
+
17
+ def all(options={})
18
+ @foursquare.get("users/self/checkins", options)["checkins"]["items"].map do |json|
19
+ Foursquare::Checkin.new(@foursquare, json)
20
+ end
21
+ end
10
22
  end
11
23
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: john-mayer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
4
+ hash: 25
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  requirements: []
97
97
 
98
98
  rubyforge_project:
99
- rubygems_version: 1.3.7
99
+ rubygems_version: 1.4.1
100
100
  signing_key:
101
101
  specification_version: 3
102
102
  summary: A Foursquare API wrapper