module Adparlor module Facebook module GraphApi class AdSet < GraphObject include Fields::AdSet 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}/adsets" end def update_path raise FbError.new('required parameter id missing', 500) unless id "/#{id}" end def activities @activities ||= CollectionProxy.new Activity, "/#{id}/activities", access_token end def adcreatives @adcreatives ||= CollectionProxy.new AdCreative, "/#{id}/adcreatives", access_token end def ads @ads ||= CollectionProxy.new Ad, "/#{id}/ads", access_token end def targetingsentencelines @targetingsentencelines ||= CollectionProxy.new TargetingSentenceLine, "/#{id}/targetingsentencelines", access_token end end end end end