Class: FbGraph::AdGroup
- Includes:
- Connections::AdCreatives
- Defined in:
- lib/fb_graph/ad_group.rb
Instance Attribute Summary collapse
-
#ad_id ⇒ Object
Returns the value of attribute ad_id.
-
#adgroup_id ⇒ Object
Returns the value of attribute adgroup_id.
-
#adgroup_status ⇒ Object
Returns the value of attribute adgroup_status.
-
#bid_info ⇒ Object
Returns the value of attribute bid_info.
-
#bid_type ⇒ Object
Returns the value of attribute bid_type.
-
#campaign_id ⇒ Object
Returns the value of attribute campaign_id.
-
#creative ⇒ Object
Returns the value of attribute creative.
-
#creative_ids ⇒ Object
Returns the value of attribute creative_ids.
-
#disapprove_reason_descriptions ⇒ Object
Returns the value of attribute disapprove_reason_descriptions.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#max_bid ⇒ Object
Returns the value of attribute max_bid.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#targeting ⇒ Object
Returns the value of attribute targeting.
-
#updated_time ⇒ Object
Returns the value of attribute updated_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier, #raw_attributes
Instance Method Summary collapse
- #creatives(fetch = true) ⇒ Object
-
#initialize(identifier, attributes = {}) ⇒ AdGroup
constructor
A new instance of AdGroup.
-
#update(options) ⇒ Object
We override update to handle the “redownload” parameter If redownload is specified, the FbGraph::AdGroup object will be updated with the data returned from Facebook.
Methods included from Connections::AdCreatives
Methods inherited from Node
#connection, #destroy, fetch, #fetch
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ AdGroup
Returns a new instance of AdGroup.
8 9 10 11 |
# File 'lib/fb_graph/ad_group.rb', line 8 def initialize(identifier, attributes = {}) super set_attrs(attributes) end |
Instance Attribute Details
#ad_id ⇒ Object
Returns the value of attribute ad_id.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def ad_id @ad_id end |
#adgroup_id ⇒ Object
Returns the value of attribute adgroup_id.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def adgroup_id @adgroup_id end |
#adgroup_status ⇒ Object
Returns the value of attribute adgroup_status.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def adgroup_status @adgroup_status end |
#bid_info ⇒ Object
Returns the value of attribute bid_info.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def bid_info @bid_info end |
#bid_type ⇒ Object
Returns the value of attribute bid_type.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def bid_type @bid_type end |
#campaign_id ⇒ Object
Returns the value of attribute campaign_id.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def campaign_id @campaign_id end |
#creative ⇒ Object
Returns the value of attribute creative.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def creative @creative end |
#creative_ids ⇒ Object
Returns the value of attribute creative_ids.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def creative_ids @creative_ids end |
#disapprove_reason_descriptions ⇒ Object
Returns the value of attribute disapprove_reason_descriptions.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def disapprove_reason_descriptions @disapprove_reason_descriptions end |
#end_time ⇒ Object
Returns the value of attribute end_time.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def end_time @end_time end |
#max_bid ⇒ Object
Returns the value of attribute max_bid.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def max_bid @max_bid end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def name @name end |
#start_time ⇒ Object
Returns the value of attribute start_time.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def start_time @start_time end |
#targeting ⇒ Object
Returns the value of attribute targeting.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def targeting @targeting end |
#updated_time ⇒ Object
Returns the value of attribute updated_time.
5 6 7 |
# File 'lib/fb_graph/ad_group.rb', line 5 def updated_time @updated_time end |
Instance Method Details
#creatives(fetch = true) ⇒ Object
26 27 28 |
# File 'lib/fb_graph/ad_group.rb', line 26 def creatives(fetch = true) creative_ids.map { |creative_id| fetch ? AdCreative.fetch(creative_id) : AdCreative.new(creative_id) } end |
#update(options) ⇒ Object
We override update to handle the “redownload” parameter If redownload is specified, the FbGraph::AdGroup object will be updated with the data returned from Facebook.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fb_graph/ad_group.rb', line 15 def update() response = super() if [:redownload] attributes = .merge(response[:data][:adgroups][identifier]).with_indifferent_access set_attrs(attributes) end response end |