Class: FbGraph::AdCampaign
- Includes:
- Connections::AdGroups
- Defined in:
- lib/fb_graph/ad_campaign.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#campaign_id ⇒ Object
Returns the value of attribute campaign_id.
-
#campaign_status ⇒ Object
Returns the value of attribute campaign_status.
-
#daily_budget ⇒ Object
Returns the value of attribute daily_budget.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#lifetime_budget ⇒ Object
Returns the value of attribute lifetime_budget.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
Attributes inherited from Node
#access_token, #endpoint, #identifier
Instance Method Summary collapse
-
#initialize(identifier, attributes = {}) ⇒ AdCampaign
constructor
A new instance of AdCampaign.
Methods included from Connections::AdGroups
Methods inherited from Node
#connection, #destroy, fetch, #fetch, #update
Methods included from Comparison
Constructor Details
#initialize(identifier, attributes = {}) ⇒ AdCampaign
Returns a new instance of AdCampaign.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fb_graph/ad_campaign.rb', line 7 def initialize(identifier, attributes = {}) super %w(campaign_id account_id name daily_budget campaign_status lifetime_budget).each do |field| send("#{field}=", attributes[field.to_sym]) end %w(start_time end_time).each do |field| if val = attributes[field.to_sym] # Handles integer timestamps and ISO8601 strings time = Time.parse(val) rescue Time.at(val.to_i) send("#{field}=", time) end end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def account_id @account_id end |
#campaign_id ⇒ Object
Returns the value of attribute campaign_id.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def campaign_id @campaign_id end |
#campaign_status ⇒ Object
Returns the value of attribute campaign_status.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def campaign_status @campaign_status end |
#daily_budget ⇒ Object
Returns the value of attribute daily_budget.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def daily_budget @daily_budget end |
#end_time ⇒ Object
Returns the value of attribute end_time.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def end_time @end_time end |
#lifetime_budget ⇒ Object
Returns the value of attribute lifetime_budget.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.rb', line 5 def lifetime_budget @lifetime_budget end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fb_graph/ad_campaign.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_campaign.rb', line 5 def start_time @start_time end |