Class: Adparlor::Facebook::GraphApi::Ad

Inherits:
GraphObject show all
Includes:
Fields::Ad, Traits::Methods
Defined in:
lib/adparlor/facebook/graph_api/ad.rb

Constant Summary

Constants included from Fields::Ad

Fields::Ad::CREATE_FIELDS, Fields::Ad::FIELDS, Fields::Ad::UPDATE_FIELDS

Constants included from Fields::FieldDecorator

Fields::FieldDecorator::GLOBAL_FIELDS

Instance Attribute Summary

Attributes inherited from GraphObject

#access_token

Instance Method Summary collapse

Methods included from Traits::Methods

#create, #destroy, included, #update

Methods inherited from GraphObject

#batch, create, #create, data_pass_through, destroy, #destroy, get, #initialize, parse_data_for_collection, read, respond_for_data, #to_hash, #to_json, #update, update

Methods included from Api

#base_uri, #conn, #conn_multi, #delete, #get, #post, #proxy_api_key

Methods included from Fields::FieldDecorator

included

Constructor Details

This class inherits a constructor from Adparlor::Facebook::GraphApi::GraphObject

Instance Method Details

#adcreativesObject



21
22
23
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 21

def adcreatives
  @adcreatives ||= CollectionProxy.new AdCreative, "/#{id}/adcreatives", access_token
end

#leadsObject



25
26
27
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 25

def leads
  @leads ||= CollectionProxy.new UserLeadGenInfo, "/#{id}/leads", access_token
end

#pathObject

Raises:



11
12
13
14
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 11

def path
  raise FbError.new('required parameter account_id missing', 500) unless 
  "/act_#{}/ads"
end

#previewsObject



29
30
31
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 29

def previews
  @previews ||= CollectionProxy.new(AdPreview, "/#{id}/previews", access_token)
end

#reachestimateObject



33
34
35
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 33

def reachestimate
  @reachestimate ||= CollectionProxy.new ReachEstimate, "/#{id}/reachestimate", access_token
end

#targetingsentencelinesObject



37
38
39
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 37

def targetingsentencelines
  @targetingsentencelines ||= CollectionProxy.new TargetingSentenceLine, "/#{id}/targetingsentencelines", access_token
end

#update_pathObject

Raises:



16
17
18
19
# File 'lib/adparlor/facebook/graph_api/ad.rb', line 16

def update_path
  raise FbError.new('required parameter id missing', 500) unless id
  "/#{id}"
end