Class: FbGraph::AdAccount

Inherits:
Node
  • Object
show all
Includes:
Connections::AdCampaignStats, Connections::AdCampaigns, Connections::AdConnectionObjects, Connections::AdGroupStats, Connections::AdGroups, Connections::AdPreviews, Connections::BroadTargetingCategories, Connections::ReachEstimates
Defined in:
lib/fb_graph/ad_account.rb

Constant Summary

ATTRS =
[
  :account_id,
  :name,
  :account_status,
  :daily_spend_limit,
  :users,
  :currency,
  :timezone_id,
  :timezone_name,
  :capabilities,
  :account_groups,
  :is_personal,
  :business_name,
  :business_street,
  :business_street2,
  :business_city,
  :business_state,
  :business_zip,
  :business_country_code,
  :vat_status,
  :agency_client_declaration,
  :spend_cap,
  :amount_spent
]

Instance Attribute Summary

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary (collapse)

Methods included from Connections::AdPreviews

#ad_previews

Methods included from Connections::AdConnectionObjects

#connection_objects

Methods included from Connections::ReachEstimates

#reach_estimates

Methods included from Connections::BroadTargetingCategories

#broad_targeting_categories

Methods included from Connections::AdGroupStats

#ad_group_stats

Methods included from Connections::AdCampaignStats

#ad_campaign_stats

Methods included from Connections::AdGroups

#ad_group!, #ad_groups

Methods included from Connections::AdCampaigns

#ad_campaign!, #ad_campaigns

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

- (AdAccount) initialize(identifier, attributes = {})

Returns a new instance of AdAccount



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fb_graph/ad_account.rb', line 39

def initialize(identifier, attributes = {})
  super

  ATTRS.each do |field|
    send("#{field}=", attributes[field.to_sym])
  end

  if attributes[:users]
    self.users = attributes[:users].collect { |u| FbGraph::AdUser.new(u["uid"], u) }
  end
end