Method: FacebookAds::APIRequest#execute

Defined in:
lib/facebook_ads/api_request.rb

#execute(&block) ⇒ Object

Returns either APIResponse instantly if not within a batch, or a Proxy object to the result if a batch is present.

Examples

Illustrate the behaviour of the method using examples. Indent examples:

api_request APIRequest.new(:get, '123545') do |response|
  update_attributes(response)
end


34
35
36
37
# File 'lib/facebook_ads/api_request.rb', line 34

def execute(&block)
  @callback = block if block
  is_in_batch? ? enqueue_to_batch : execute_now
end