Class: Foursquare::CheckinProxy
- Inherits:
-
Object
- Object
- Foursquare::CheckinProxy
- Defined in:
- lib/foursquare/checkin_proxy.rb
Instance Method Summary collapse
- #all(options = {}) ⇒ Object
- #create(options = {}) ⇒ Object (also: #add)
- #find(id) ⇒ Object
-
#initialize(foursquare) ⇒ CheckinProxy
constructor
A new instance of CheckinProxy.
- #recent(options = {}) ⇒ Object
Constructor Details
#initialize(foursquare) ⇒ CheckinProxy
Returns a new instance of CheckinProxy.
3 4 5 |
# File 'lib/foursquare/checkin_proxy.rb', line 3 def initialize(foursquare) @foursquare = foursquare end |
Instance Method Details
#all(options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/foursquare/checkin_proxy.rb', line 17 def all(={}) @foursquare.get("users/self/checkins", )["checkins"]["items"].map do |json| Foursquare::Checkin.new(@foursquare, json) end end |
#create(options = {}) ⇒ Object Also known as: add
23 24 25 26 27 28 29 |
# File 'lib/foursquare/checkin_proxy.rb', line 23 def create(={}) if json = @foursquare.post("checkins/add", ) Foursquare::Checkin.new(@foursquare, json["checkin"]) else nil end end |
#find(id) ⇒ Object
7 8 9 |
# File 'lib/foursquare/checkin_proxy.rb', line 7 def find(id) Foursquare::Checkin.new(@foursquare, @foursquare.get("checkins/#{id}")["checkin"]) end |
#recent(options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/foursquare/checkin_proxy.rb', line 11 def recent(={}) @foursquare.get("checkins/recent", )["recent"].map do |json| Foursquare::Checkin.new(@foursquare, json) end end |