Module: XeroKiwi

Defined in:
lib/xero_kiwi.rb,
lib/xero_kiwi/page.rb,
lib/xero_kiwi/oauth.rb,
lib/xero_kiwi/query.rb,
lib/xero_kiwi/token.rb,
lib/xero_kiwi/client.rb,
lib/xero_kiwi/errors.rb,
lib/xero_kiwi/version.rb,
lib/xero_kiwi/identity.rb,
lib/xero_kiwi/throttle.rb,
lib/xero_kiwi/connection.rb,
lib/xero_kiwi/oauth/pkce.rb,
lib/xero_kiwi/query/order.rb,
lib/xero_kiwi/query/filter.rb,
lib/xero_kiwi/oauth/id_token.rb,
lib/xero_kiwi/accounting/user.rb,
lib/xero_kiwi/token_refresher.rb,
lib/xero_kiwi/accounting/phone.rb,
lib/xero_kiwi/accounting/address.rb,
lib/xero_kiwi/accounting/contact.rb,
lib/xero_kiwi/accounting/invoice.rb,
lib/xero_kiwi/accounting/payment.rb,
lib/xero_kiwi/accounting/hydrator.rb,
lib/xero_kiwi/accounting/resource.rb,
lib/xero_kiwi/throttle/middleware.rb,
lib/xero_kiwi/accounting/line_item.rb,
lib/xero_kiwi/accounting/allocation.rb,
lib/xero_kiwi/accounting/prepayment.rb,
lib/xero_kiwi/throttle/null_limiter.rb,
lib/xero_kiwi/accounting/credit_note.rb,
lib/xero_kiwi/accounting/overpayment.rb,
lib/xero_kiwi/accounting/organisation.rb,
lib/xero_kiwi/accounting/contact_group.rb,
lib/xero_kiwi/accounting/external_link.rb,
lib/xero_kiwi/accounting/payment_terms.rb,
lib/xero_kiwi/accounting/branding_theme.rb,
lib/xero_kiwi/accounting/contact_person.rb,
lib/xero_kiwi/throttle/redis_token_bucket.rb,
lib/xero_kiwi/accounting/tracking_category.rb

Defined Under Namespace

Modules: Accounting, Identity, Query, Throttle Classes: APIError, AuthenticationError, Client, ClientError, Connection, Error, OAuth, Page, RateLimitError, ServerError, Token, TokenRefreshError, TokenRefresher

Constant Summary collapse

VERSION =
"0.4.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_throttleObject

Default throttle limiter applied to every new Client that doesn’t pass its own ‘throttle:` kwarg. Lets a Rails app wire one shared limiter (e.g. a RedisTokenBucket) in an initializer without threading it through every call site. Per-instance `throttle:` still wins.



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

def default_throttle
  @default_throttle
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields the module for block-style configuration.

XeroKiwi.configure do |c|
  c.default_throttle = XeroKiwi::Throttle::RedisTokenBucket.new(...)
end

Yields:

  • (_self)

Yield Parameters:

  • _self (XeroKiwi)

    the object that the method was called on



51
52
53
# File 'lib/xero_kiwi.rb', line 51

def self.configure
  yield self
end