Sha256: faa7596fbcdf8717ded099ec6608492198ca9e35787cc0b57410cc37ed744c9d

Contents?: true

Size: 1.15 KB

Versions: 27

Compression:

Stored size: 1.15 KB

Contents

module FbGraph
  class AdAccount < Node
    include Connections::AdCampaigns
    include Connections::AdGroups
    include Connections::AdCampaignStats
    include Connections::AdGroupStats
    include Connections::BroadTargetingCategories
    include Connections::ReachEstimates
    include Connections::AdConnectionObjects
    include Connections::AdPreviews

    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
    ]

    attr_accessor *ATTRS

    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
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
fb_graph-2.6.3 lib/fb_graph/ad_account.rb
fb_graph-2.6.2 lib/fb_graph/ad_account.rb
fb_graph-2.6.1 lib/fb_graph/ad_account.rb
fb_graph-2.6.0 lib/fb_graph/ad_account.rb
fb_graph-2.5.9 lib/fb_graph/ad_account.rb
fb_graph-2.5.8 lib/fb_graph/ad_account.rb
fb_graph-2.5.7 lib/fb_graph/ad_account.rb