Class: Adzerk::Reporting
- Inherits:
-
Object
- Object
- Adzerk::Reporting
- Includes:
- Util
- Defined in:
- lib/adzerk/reporting.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #create_queued_report(data = {}) ⇒ Object
- #create_report(data = {}) ⇒ Object
-
#initialize(args = {}) ⇒ Reporting
constructor
A new instance of Reporting.
- #retrieve_queued_report(id) ⇒ Object
Methods included from Util
#camelize_data, #parse_response, #uncamelize_data
Constructor Details
#initialize(args = {}) ⇒ Reporting
Returns a new instance of Reporting.
7 8 9 |
# File 'lib/adzerk/reporting.rb', line 7 def initialize(args = {}) @client = args.fetch(:client) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/adzerk/reporting.rb', line 5 def client @client end |
Instance Method Details
#create_queued_report(data = {}) ⇒ Object
16 17 18 19 |
# File 'lib/adzerk/reporting.rb', line 16 def create_queued_report(data={}) data = { 'criteria' => camelize_data(data).to_json } parse_response(client.post_request('report/queue', data)) end |
#create_report(data = {}) ⇒ Object
11 12 13 14 |
# File 'lib/adzerk/reporting.rb', line 11 def create_report(data={}) data = { 'criteria' => camelize_data(data).to_json } parse_response(client.post_request('report', data)) end |
#retrieve_queued_report(id) ⇒ Object
21 22 23 24 |
# File 'lib/adzerk/reporting.rb', line 21 def retrieve_queued_report(id) url = 'report/queue/' + id parse_response(client.get_request(url)) end |