Module: FbGraph::Connections::Offers

Included in:
Page
Defined in:
lib/fb_graph/connections/offers.rb

Instance Method Summary collapse

Instance Method Details

#offer!(options = {}) ⇒ Object


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

def offer!(options = {})
  # A page access token is required to change an associated offer
  offer = post options.merge(:connection => :offers).merge(:access_token => self.page_access_token)
  Offer.new offer[:id], options.merge(offer).merge(
    :access_token => options[:access_token] || self.access_token
  )
end

#offers(options = {}) ⇒ Object


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

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