Class: AppleReporter::Finance

Inherits:
Reporter
  • Object
show all
Defined in:
lib/apple_reporter/finance.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/finance.rb', line 8

def getAccounts
  fetch(@config[:finance_path], 'Finance.getAccounts')
end

#getReport(params = {}) ⇒ Object

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

Usage:

report = reporter.getReport(

{
  vendor_number: 'myVendor',
  region_code: 'US',
  report_type: 'Financial',
  fiscal_year: '2016',
  fiscal_period: '02'
}

)



42
43
44
# File 'lib/apple_reporter/finance.rb', line 42

def getReport(params = {})
  fetch(@config[:finance_path], (['Finance.getReport'] + [params.slice(:vendor_number, :region_code, :report_type, :fiscal_year, :fiscal_period).values.join(',')]).join(', '))
end

#getStatusObject

getStatus

Usage:

report = reporter.getStatus


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

def getStatus
  fetch(@config[:finance_path], 'Finance.getStatus')
end

#getVendorsAndRegionsObject

getVendorsAndRegions

Usage:

report = reporter.getVendorsAndRegions


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

def getVendorsAndRegions
  fetch(@config[:finance_path], 'Finance.getVendorsAndRegions')
end

#getVersionObject



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

def getVersion
  @config[:version]
end