Module: FbGraph::Connections::Comments

Included in:
Album, FbGraph::Checkin, FbGraph::Comment, Link, Note, OpenGraph::Action, Photo, Post, Status, UserAchievement, Video
Defined in:
lib/fb_graph/connections/comments.rb

Instance Method Summary collapse

Instance Method Details

#comment!(options = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/fb_graph/connections/comments.rb', line 13

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

#comments(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/fb_graph/connections/comments.rb', line 4

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

#reply!(options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/fb_graph/connections/comments.rb', line 20

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