Sha256: 1eaa354158740a4046b2465ea247ae9c937654b320da35335a8a7ad6d6b1918c

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

module FbGraph
  module Connections
    module Likes
      def likes(options = {})
        likes = self.connection(:likes, options)
        likes.map! do |like|
          like.merge!(
            :access_token => options[:access_token] || self.access_token
          )
          if like[:category]
            Page.new(like[:id], like)
          else
            User.new(like[:id], like)
          end
        end
      end

      module Likable
        def like!(options = {})
          post(options.merge(:connection => :likes))
        end

        def unlike!(options = {})
          destroy(options.merge(:connection => :likes))
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-2.2.6 lib/fb_graph/connections/likes.rb
fb_graph-2.2.5 lib/fb_graph/connections/likes.rb
fb_graph-2.2.4 lib/fb_graph/connections/likes.rb
fb_graph-2.2.3 lib/fb_graph/connections/likes.rb