Module: FbGraph::Connections::AppRequests

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

Instance Method Summary collapse

Instance Method Details

#app_request!(options = {}) ⇒ Object



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

def app_request!(options = {})
  app_request = post options.merge(:connection => :apprequests)
  AppRequest.new "#{app_request[:request]}_#{app_request[:to].first}", options.merge(
    :access_token => options[:access_token] || self.access_token
  )
end

#app_requests(options = {}) ⇒ Object



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

def app_requests(options = {})
  app_requests = self.connection :apprequests, options
  app_requests.map! do |app_request|
    AppRequest.new app_request[:id], app_request.merge(
      :access_token => options[:access_token] || self.access_token
    )
  end
end