Class: SlidePay::AccountReport

Inherits:
PostReport show all
Defined in:
lib/slidepay/reports/account_report.rb

Instance Attribute Summary

Attributes inherited from Report

#api_key, #endpoint, #report_type, #sfa, #token, #url

Instance Method Summary collapse

Methods inherited from Report

#retrieve

Constructor Details

#initialize(options = {}) ⇒ AccountReport

Returns a new instance of AccountReport.



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/slidepay/reports/account_report.rb', line 3

def initialize(options={})
  @url = "report/account"

  if options.is_a? String or options.is_a? Integer
    @sfa = [{field: "location_id", condition: "equals", value: options}]
  elsif options['location_id'] != nil or options[:location_id] != nil
    @sfa = [{field: "location_id", condition: "equals", value: options['location_id'] || options[:location_id]}]
  else
    @sfa = []
  end

  super(@sfa)
end