Class: AppleReporter::Finance

Inherits:
Reporter
  • Object
show all
Defined in:
lib/apple_reporter/finance.rb

Constant Summary

Constants inherited from Reporter

Reporter::ENDPOINT, Reporter::GZIP_MIMETYPE

Instance Method Summary collapse

Methods inherited from Reporter

#initialize

Constructor Details

This class inherits a constructor from AppleReporter::Reporter

Instance Method Details

#accountsObject

accounts

Usage:

report = reporter.accounts


7
8
9
# File 'lib/apple_reporter/finance.rb', line 7

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

#get_report(params = {}) ⇒ Object

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

Usage:

report = reporter.get_report(

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

)



39
40
41
# File 'lib/apple_reporter/finance.rb', line 39

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

#statusObject

status

Usage:

report = reporter.status


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

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

#vendors_and_regionsObject

vendors_and_regions

Usage:

report = reporter.vendors_and_regions


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

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

#versionObject



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

def version
  @config[:version]
end