Class: AppleReporter::Sale

Inherits:
Reporter show all
Defined in:
lib/apple_reporter/sale.rb

Constant Summary

Constants inherited from Reporter

Reporter::ENDPOINT

Instance Method Summary collapse

Methods inherited from Reporter

#initialize

Constructor Details

This class inherits a constructor from AppleReporter::Reporter

Instance Method Details

#getAccountsObject

getAccounts

Usage:

report = reporter.getAccounts


8
9
10
# File 'lib/apple_reporter/sale.rb', line 8

def getAccounts
  fetch(@config[:sales_path], 'Sales.getAccounts')
end

#getReport(params = {}) ⇒ Object

getReport Refer to: help.apple.com/itc/appsreporterguide/

Usage:

report = reporter.getReport(

{
  vendor_number: 'myVendor',
  report_type: 'Sales',
  report_sub_type: 'Summary',
  date_type: 'Daily',
  date: '20161212'
}

)



46
47
48
# File 'lib/apple_reporter/sale.rb', line 46

def getReport(params = {})
  fetch(@config[:sales_path], (['Sales.getReport'] + [params.slice(:vendor_number, :report_type, :report_sub_type, :date_type, :date).values.join(',')]).join(', '))
end

#getStatusObject

getStatus

Usage:

report = reporter.getStatus


16
17
18
# File 'lib/apple_reporter/sale.rb', line 16

def getStatus
  fetch(@config[:sales_path], 'Sales.getStatus')
end

#getVendorsObject

getVendors

Usage:

report = reporter.getVendors


24
25
26
# File 'lib/apple_reporter/sale.rb', line 24

def getVendors
  fetch(@config[:sales_path], 'Sales.getVendors')
end

#getVersionObject



28
29
30
# File 'lib/apple_reporter/sale.rb', line 28

def getVersion
  @config[:version]
end