Sha256: 182425f7800df21ea82f9548c61b39f9236ce1ff945abd75d568f27356d81d51

Contents?: true

Size: 764 Bytes

Versions: 8

Compression:

Stored size: 764 Bytes

Contents

module FbGraph
  module Connections
    module Comments
      def comments(options = {})
        comments = if @_comments_ && options.blank?
          self.connection(:comments, options.merge(:cached_collection => @_comments_))
        else
          self.connection(:comments, options)
        end
        comments.map! do |comment|
          Comment.new(comment[:id], comment.merge(
            :access_token => options[:access_token] || self.access_token
          ))
        end
      end

      def comment!(options = {})
        comment = post(options.merge(:connection => :comments))
        Comment.new(comment[:id], options.merge(comment).merge(
          :access_token => options[:access_token] || self.access_token
        ))
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fb_graph-2.2.2 lib/fb_graph/connections/comments.rb
fb_graph-2.2.1 lib/fb_graph/connections/comments.rb
fb_graph-2.2.0 lib/fb_graph/connections/comments.rb
fb_graph-2.2.0.beta lib/fb_graph/connections/comments.rb
fb_graph-2.2.0.alpha2 lib/fb_graph/connections/comments.rb
fb_graph-2.2.0.alpha lib/fb_graph/connections/comments.rb
fb_graph-2.1.13 lib/fb_graph/connections/comments.rb
fb_graph-2.1.12 lib/fb_graph/connections/comments.rb