Class: GSGraph::AdAccount

Constant Summary collapse

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

#initialize(identifier, attributes = {}) ⇒ AdAccount

Returns a new instance of AdAccount.



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/gs_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| GSGraph::AdUser.new(u["uid"], u) }
  end
end