Class: Outbrain::Api::Report

Inherits:
Base
  • Object
show all
Defined in:
lib/outbrain/api/report.rb

Constant Summary collapse

REPORT_PARAMETERS =
[:from, :to, :limit, :offset, :sort]
RESOURCE_NAME =
'details'

Instance Attribute Summary

Attributes inherited from Base

#errors

Class Method Summary collapse

Methods inherited from Base

#initialize, #persisted?, #valid?

Constructor Details

This class inherits a constructor from Outbrain::Base

Class Method Details

.where(options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/outbrain/api/report.rb', line 7

def self.where(options = {})
  report_query = options.select{|option, v| REPORT_PARAMETERS.include?(option) && !v.nil?}        
  report_options = { as: self, resource_name: RESOURCE_NAME, meta_resource_names: options.fetch(:meta_resource_names, []) }
  Request.where(options.fetch(:path), report_query, report_options)
end