Sha256: 05094976ab84e46bbc7903c499b774faeaf13ffd178f7ae3a9b779d2f8d590a4

Contents?: true

Size: 1.63 KB

Versions: 3

Compression:

Stored size: 1.63 KB

Contents

require 'xeroizer/record/application_helper'

module Xeroizer
  class GenericApplication

    include Http
    extend Record::ApplicationHelper

    attr_reader :client, :xero_url, :logger, :rate_limit_sleep, :rate_limit_max_attempts, :default_headers

    extend Forwardable
    def_delegators :client, :access_token

    record :Account
    record :Attachment
    record :BrandingTheme
    record :Contact
    record :CreditNote
    record :Currency
    record :Employee
    record :ExpenseClaim
    record :Invoice
    record :Item
    record :Journal
    record :ManualJournal
    record :Organisation
    record :Payment
    record :Receipt
    record :TaxRate
    record :TrackingCategory
    record :BankTransaction
    record :User

    report :AgedPayablesByContact
    report :AgedReceivablesByContact
    report :BalanceSheet
    report :BankStatement
    report :BankSummary
    report :BudgetSummary
    report :ExecutiveSummary
    report :ProfitAndLoss
    report :TrialBalance

    public

      # Never used directly. Use sub-classes instead.
      # @see PublicApplication
      # @see PrivateApplication
      # @see PartnerApplication
      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] || {}
        @client   = OAuth.new(consumer_key, consumer_secret, options.merge({default_headers: default_headers}))
        @logger = options[:logger] || false
      end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
xeroizer-2.15.8 lib/xeroizer/generic_application.rb
xeroizer-2.15.7 lib/xeroizer/generic_application.rb
xeroizer-2.15.6 lib/xeroizer/generic_application.rb