Module: FbGraph::Connections::Messages

Included in:
Thread
Defined in:
lib/fb_graph/connections/messages.rb

Instance Method Summary collapse

Instance Method Details

#message!(message, options = {}) ⇒ Object



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

def message!(message, options = {})
  options[:message] = message
  message = post options.merge(:connection => :messages)
  Message.new message[:id], message.merge(options).merge(
    :access_token => options[:access_token] || self.access_token
  )
end

#messages(options = {}) ⇒ Object



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

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