Sha256: e3cc417a0d319cf3555ba682c719c5016ce518327ac279c6138d58bef6634f8a

Contents?: true

Size: 561 Bytes

Versions: 16

Compression:

Stored size: 561 Bytes

Contents

module FbGraph
  module Connections
    module MutualFriends
      def mutual_friends(friend, options = {})
        friends = self.connection(:mutualfriends, options.merge(:connection_scope => connection_scope(friend)))
        friends.map! do |friend|
          User.new(friend[:id], friend.merge(:access_token => options[:access_token] || self.access_token))
        end
      end

      private

      def connection_scope(friend)
        if friend.is_a?(User)
          friend.identifier
        else
          friend
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fb_graph-2.2.6 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.5 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.4 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.3 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.2 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.1 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.0 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.0.beta lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.0.alpha2 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.2.0.alpha lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.13 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.12 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.11 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.10 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.9 lib/fb_graph/connections/mutual_friends.rb
fb_graph-2.1.8 lib/fb_graph/connections/mutual_friends.rb