Module: FbGraph::Connections::Checkins

Included in:
Page, TestUser, User
Defined in:
lib/fb_graph/connections/checkins.rb

Overview

Fetch checkins

  • To get a user’s check-ins, request the “user_checkins”.

  • To see the user’s friends’ check-ins, request the “friends_checkins”.

ref) developers.facebook.com/docs/api#places

FbGraph::User.new("matake").checkins(:access_token => ACCESS_TOKEN)
FbGraph::Page.new("Tokyo").checkins(:access_token => ACCESS_TOKEN)

Instance Method Summary collapse

Instance Method Details

#checkin!(options = {}) ⇒ Object



21
22
23
24
25
26
# File 'lib/fb_graph/connections/checkins.rb', line 21

def checkin!(options = {})
  checkin = post(options.merge(:connection => :checkins))
  Checkin.new(checkin.delete(:id), options.merge(checkin).merge(
    :access_token => options[:access_token] || self.access_token
  ))
end

#checkins(options = {}) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/fb_graph/connections/checkins.rb', line 12

def checkins(options = {})
  checkins = self.connection(:checkins, options)
  checkins.map! do |checkin|
    Checkin.new(checkin.delete(:id), checkin.merge(
      :access_token => options[:access_token] || self.access_token
    ))
  end
end