Sha256: 6d00d629be778e00218b8c8d1f5744a7a0391738d12f0514467e4435623deb30

Contents?: true

Size: 1014 Bytes

Versions: 24

Compression:

Stored size: 1014 Bytes

Contents

module FbGraph
  module Connections
    # == 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) http://developers.facebook.com/docs/api#places
    # 
    #   FbGraph::User.new("matake").checkins(:access_token => ACCESS_TOKEN)
    #   FbGraph::Page.new("Tokyo").checkins(:access_token => ACCESS_TOKEN)
    module Checkins
      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

      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
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fb_graph-1.6.1 lib/fb_graph/connections/checkins.rb
fb_graph-1.6.0 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.5 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.4 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.3 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.2 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.1 lib/fb_graph/connections/checkins.rb
fb_graph-1.5.0 lib/fb_graph/connections/checkins.rb
fb_graph-1.4.1 lib/fb_graph/connections/checkins.rb
fb_graph-1.4.0 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.9 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.8 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.7 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.6 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.5 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.4 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.3 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.2 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.1 lib/fb_graph/connections/checkins.rb
fb_graph-1.3.0 lib/fb_graph/connections/checkins.rb