module FbGraph2::Edge::Comments

Public Instance Methods

assign(attributes) click to toggle source
Calls superclass method
# File lib/fb_graph2/edge/comments.rb, line 4
def assign(attributes)
  super
  if attributes.include? :comments
    @_cached_comments = Collection.new attributes[:comments]
  end
end
comment!(params = {}) click to toggle source
# File lib/fb_graph2/edge/comments.rb, line 22
def comment!(params = {})
  comment = self.post params, edge: :comments
  Comment.new(comment[:id], params.merge(comment)).authenticate self.access_token
end
comments(params = {}) click to toggle source
# File lib/fb_graph2/edge/comments.rb, line 11
def comments(params = {})
  comments = if @_cached_comments.present? && params.blank?
    @_cached_comments
  else
    self.edge :comments, params
  end
  comments.collect! do |comment|
    Comment.new(comment[:id], comment).authenticate self.access_token
  end
end