Class: Adzerk::Creative

Inherits:
ApiEndpoint show all
Defined in:
lib/adzerk/creative.rb

Instance Attribute Summary

Attributes inherited from ApiEndpoint

#client, #datakey, #endpoint, #subendpoint

Instance Method Summary collapse

Methods inherited from ApiEndpoint

#delete, #get, #initialize, #update

Methods included from Util

#camelize_data, #parse_response, #uncamelize_data

Constructor Details

This class inherits a constructor from Adzerk::ApiEndpoint

Instance Method Details

#create(data = {}, imagepath = '') ⇒ Object



6
7
8
9
# File 'lib/adzerk/creative.rb', line 6

def create(data= {}, imagepath='')
  response = @client.create_creative(data, imagepath)
  uncamelize_data(JSON.parse(response))
end

#list(advertiserId) ⇒ Object



11
12
13
14
# File 'lib/adzerk/creative.rb', line 11

def list(advertiserId)
  url = 'advertiser/' + advertiserId.to_s + "/creatives"
  parse_response(@client.get_request(url))
end