Sha256: fb1f726f1e29fd57121dfa99d06b5ec727198db7ae84bede2526b0eadb722fe1

Contents?: true

Size: 1.23 KB

Versions: 20

Compression:

Stored size: 1.23 KB

Contents

module Adparlor
  module Facebook
    module GraphApi
      class Ad < GraphObject
        include Fields::Ad
        include Traits::Methods
        field_attrs FIELDS
        allow_method :create
        allow_local_method :create, :update, :destroy

        def path
          raise FbError.new('required parameter account_id missing', 500) unless account_id
          "/act_#{account_id}/ads"
        end

        def update_path
          raise FbError.new('required parameter id missing', 500) unless id
          "/#{id}"
        end

        def adcreatives
          @adcreatives ||= CollectionProxy.new AdCreative, "/#{id}/adcreatives", access_token
        end

        def leads
          @leads ||= CollectionProxy.new UserLeadGenInfo, "/#{id}/leads", access_token
        end

        def previews
          @previews ||= CollectionProxy.new(AdPreview, "/#{id}/previews", access_token)
        end

        def reachestimate
          @reachestimate ||= CollectionProxy.new ReachEstimate, "/#{id}/reachestimate", access_token
        end

        def targetingsentencelines
          @targetingsentencelines ||= CollectionProxy.new TargetingSentenceLine, "/#{id}/targetingsentencelines", access_token
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
adparlor-facebook-0.8.2 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.8.0 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.9 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.8 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.7 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.6 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.5 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.4 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.3 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.2 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.1 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.7.0 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.6 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.5 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.4 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.3 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.2 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.1 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.6.0 lib/adparlor/facebook/graph_api/ad.rb
adparlor-facebook-0.5.9 lib/adparlor/facebook/graph_api/ad.rb