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/resource_parser.rb,
lib/booqable/strict_attributes.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,
sig/booqable.rbs

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, StrictAttributes Classes: BadGateway, BadRequest, Client, ClientError, CompanyNotFound, CompanyRequired, ConfigArgumentError, Conflict, Deprecated, Error, ExtraFieldsInWrongFormat, FailedTypecasting, FeatureNotEnabled, FieldsInWrongFormat, Forbidden, InternalServerError, InvalidDateFormat, InvalidDateTimeFormat, InvalidFilter, InvalidGrant, JsonApiSerializer, Locked, MethodNotAllowed, MissingAttribute, NotAcceptable, NotFound, NotImplemented, OAuthClient, PageShouldBeAnObject, PaymentRequired, PrivateKeyOrSecretRequired, RateLimit, ReadOnlyAttribute, ReadOnlyMode, RefreshTokenRevoked, RequiredAuthParamMissing, RequiredFilter, ResourceParser, ResourceProxy, SawyerAgent, ServerError, ServiceUnavailable, SingleUseTokenAlgorithmRequired, SingleUseTokenCompanyIdRequired, SingleUseTokenUserIdRequired, TokenRevoked, TooManyRequests, TrialExpired, Unauthorized, UnknownAttribute, UnprocessableEntity, UnsupportedAPIVersion, UnsupportedMediaType

Constant Summary collapse

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

Returns:

  • (String)
"2.0.0"

Class Method Summary collapse

Class Method Details

.clientBooqable::Client

API client based on configured options Configurable

Returns:



54
55
56
57
58
# File 'lib/booqable.rb', line 54

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

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