Class: Adzerk::Creative
- Inherits:
-
ApiEndpoint
- Object
- ApiEndpoint
- Adzerk::Creative
- Defined in:
- lib/adzerk/creative.rb
Instance Attribute Summary
Attributes inherited from ApiEndpoint
#client, #datakey, #endpoint, #subendpoint
Instance Method Summary collapse
- #create(data = {}, imagepath = '') ⇒ Object
- #list(advertiserId, page: 1, pageSize: 500) ⇒ Object
- #list_for_network(page: 1, pageSize: 500) ⇒ Object
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, page: 1, pageSize: 500) ⇒ Object
11 12 13 14 |
# File 'lib/adzerk/creative.rb', line 11 def list(advertiserId, page: 1, pageSize: 500) url = "advertiser/#{advertiserId}/creatives?page=#{page}&pageSize=#{pageSize}" parse_response(@client.get_request(url)) end |
#list_for_network(page: 1, pageSize: 500) ⇒ Object
16 17 18 19 |
# File 'lib/adzerk/creative.rb', line 16 def list_for_network(page: 1, pageSize: 500) url = "creative?page=#{page}&pageSize=#{pageSize}" parse_response(@client.get_request(url)) end |