Sha256: 4fe0605b59bb40ce5d3f5d31318d928d1e0763b676a8ec8e9fe93732f3a13281
Contents?: true
Size: 1.11 KB
Versions: 6
Compression:
Stored size: 1.11 KB
Contents
module Adparlor module Facebook module GraphApi class Campaign < GraphObject include Fields::Campaign include Traits::Methods field_attrs FIELDS allow_method :create allow_local_method :create, :destroy, :update class << self def destroy(attributes = {}, options = {}) obj = new(attributes.merge(status: 'DELETED')) obj.post(obj.update_path, options, 'DELETE') end end def path raise FbError.new('required parameter account_id missing', 500) unless account_id "/act_#{account_id}/campaigns" end def update_path raise FbError.new('required parameter id missing', 500) unless id "/#{id}" end def delete raise FbError.new('delete not available, use soft delete update', 500) end def ads @ads ||= CollectionProxy.new(Ad, "/#{id}/ads", access_token) end def adsets @adsets ||= CollectionProxy.new(AdSet, "/#{id}/adsets", access_token) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems