Module: FbGraph::Connections::Inbox

Included in:
User
Defined in:
lib/fb_graph/connections/inbox.rb

Instance Method Summary collapse

Instance Method Details

#inbox(options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/fb_graph/connections/inbox.rb', line 4

def inbox(options = {})
  threads = self.connection(:inbox, options)
  threads.map! do |thread|
    # NOTE:
    #  Inbox API doesn't return thread object until their message platform becomes broadly available.
    #  Use Post instead of Thread for now.
    Post.new(thread[:id], thread.merge(
      :access_token => options[:access_token] || self.access_token
    ))
  end
end