Module: Booqable

Extended by:
Configurable
Defined in:
lib/booqable.rb,
lib/booqable/auth.rb,
lib/booqable/http.rb,
lib/booqable/error.rb,
lib/booqable/client.rb,
lib/booqable/default.rb,
lib/booqable/version.rb,
lib/booqable/resources.rb,
lib/booqable/rate_limit.rb,
lib/booqable/configurable.rb,
lib/booqable/oauth_client.rb,
lib/booqable/resource_proxy.rb,
lib/booqable/middleware/base.rb,
lib/booqable/json_api_serializer.rb,
lib/booqable/middleware/auth/oauth.rb,
lib/booqable/middleware/raise_error.rb,
lib/booqable/middleware/auth/api_key.rb,
lib/booqable/middleware/auth/single_use.rb

Overview

Main Booqable module providing access to the Booqable API

Examples:

Basic usage

Booqable.configure do |config|
  config.api_key = "your_api_key"
  config.company_id = "your_company"
end

orders = Booqable.orders.list(include: "customer,items")
orders.each do |order|
  order.items.each do |item|
    # Process each item in the order
  end
end

Defined Under Namespace

Modules: Auth, Configurable, Default, HTTP, Middleware, Resources Classes: BadGateway, BadRequest, Client, ClientError, CompanyNotFound, CompanyRequired, ConfigArgumentError, Conflict, Deprecated, Error, ExtraFieldsInWrongFormat, FailedTypecasting, FeatureNotEnabled, FieldsInWrongFormat, Forbidden, InternalServerError, InvalidDateFormat, InvalidDateTimeFormat, InvalidFilter, InvalidGrant, JsonApiSerializer, Locked, MethodNotAllowed, NotAcceptable, NotFound, NotImplemented, OAuthClient, PageShouldBeAnObject, PaymentRequired, PrivateKeyOrSecretRequired, RateLimit, ReadOnlyAttribute, ReadOnlyMode, RefreshTokenRevoked, RequiredAuthParamMissing, RequiredFilter, ResourceProxy, ServerError, ServiceUnavailable, SingleUseTokenAlgorithmRequired, SingleUseTokenCompanyIdRequired, SingleUseTokenUserIdRequired, TokenRevoked, TooManyRequests, TrialExpired, Unauthorized, UnknownAttribute, UnprocessableEntity, UnsupportedAPIVersion, UnsupportedMediaType

Constant Summary collapse

RATE_LIMITED_ERRORS =
[ Booqable::TooManyRequests ].freeze
VERSION =
"1.0.0"

Instance Attribute Summary

Attributes included from Configurable

#api_domain, #api_endpoint, #api_key, #api_version, #auto_paginate, #client_id, #client_secret, #company_id, #connection_options, #debug, #default_media_type, #middleware, #no_retries, #per_page, #proxy, #read_token, #redirect_uri, #single_use_token, #single_use_token_algorithm, #single_use_token_company_id, #single_use_token_expiration_period, #single_use_token_private_key, #single_use_token_secret, #single_use_token_user_id, #ssl_verify_mode, #user_agent, #write_token

Class Method Summary collapse

Methods included from Configurable

configure, debug?, keys, reset!, same_options?

Class Method Details

.clientBooqable::Client

API client based on configured options Configurable

Returns:



51
52
53
54
55
# File 'lib/booqable.rb', line 51

def client
  return @client if defined?(@client) && @client.same_options?(options)

  @client = Booqable::Client.new(options)
end