Module: GSGraph::Connections::Inbox

Included in:
User
Defined in:
lib/gs_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
15
16
17
# File 'lib/gs_graph/connections/inbox.rb', line 4

def inbox(options = {})
  threads = self.connection :inbox, options
  threads.map! do |thread|
    if thread[:comments]
      Thread::BeforeTransition.new thread[:id], thread.merge(
        :access_token => options[:access_token] || self.access_token
      )
    else
      Thread.new thread[:id], thread.merge(
        :access_token => options[:access_token] || self.access_token
      )
    end
  end
end