lib/xeroizer/generic_application.rb in xeroizer-2.15.9 vs lib/xeroizer/generic_application.rb in xeroizer-2.16.0
- old
+ new
@@ -4,16 +4,18 @@
class GenericApplication
include Http
extend Record::ApplicationHelper
- attr_reader :client, :xero_url, :logger, :rate_limit_sleep, :rate_limit_max_attempts, :default_headers, :unitdp
+ attr_reader :client, :xero_url, :logger, :rate_limit_sleep, :rate_limit_max_attempts,
+ :default_headers, :unitdp, :before_request, :after_request
extend Forwardable
def_delegators :client, :access_token
record :Account
+ record :Allocation
record :Attachment
record :BrandingTheme
record :Contact
record :ContactGroup
record :CreditNote
@@ -24,11 +26,14 @@
record :Item
record :Journal
record :ManualJournal
record :Organisation
record :Payment
+ record :Prepayment
record :Receipt
+ record :RepeatingInvoice
+ record :Schedule
record :TaxRate
record :TrackingCategory
record :TrackingCategoryChild
record :BankTransaction
record :User
@@ -52,9 +57,11 @@
def initialize(consumer_key, consumer_secret, options = {})
@xero_url = options[:xero_url] || "https://api.xero.com/api.xro/2.0"
@rate_limit_sleep = options[:rate_limit_sleep] || false
@rate_limit_max_attempts = options[:rate_limit_max_attempts] || 5
@default_headers = options[:default_headers] || {}
+ @before_request = options.delete(:before_request)
+ @after_request = options.delete(:after_request)
@client = OAuth.new(consumer_key, consumer_secret, options.merge({default_headers: default_headers}))
@logger = options[:logger] || false
@unitdp = options[:unitdp] || 2
end