Sha256: 6a7e78990da68fc6ade5d0d20b9c58189cbde0e758e5391af42815388a7f5231

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

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

    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

2 entries across 2 versions & 1 rubygems

Version Path
fb_graph-2.7.17 lib/fb_graph/ad_account.rb
fb_graph-2.7.16 lib/fb_graph/ad_account.rb