class Blurb::CampaignRequests

Public Instance Methods

create_bulk(create_array) click to toggle source
Calls superclass method
# File lib/blurb/campaign_requests.rb, line 5
def create_bulk(create_array)
  create_array = map_campaign_payload(create_array)
  super(create_array)
end
update_bulk(update_array) click to toggle source
Calls superclass method
# File lib/blurb/campaign_requests.rb, line 10
def update_bulk(update_array)
  update_array = map_campaign_payload(update_array)
  super(update_array)
end

Private Instance Methods

map_campaign_payload(payload) click to toggle source
# File lib/blurb/campaign_requests.rb, line 17
def map_campaign_payload(payload)
  campaign_type_string = "sponsoredProducts" if @campaign_type == CAMPAIGN_TYPE_CODES[:sp]
  campaign_type_string = "sponsoredBrands" if @campaign_type == CAMPAIGN_TYPE_CODES[:sb]
  campaign_type_string = "sponsoredDisplays" if @campaign_type == CAMPAIGN_TYPE_CODES[:sd]
  payload.each{ |p| p[:campaign_type] = campaign_type_string }
end