Module: Boldsign
- Defined in:
- lib/boldsign.rb,
lib/boldsign/error.rb,
lib/boldsign/client.rb,
lib/boldsign/version.rb,
lib/boldsign/resource.rb,
lib/boldsign/case_convert.rb,
lib/boldsign/resources/plan.rb,
lib/boldsign/resources/team.rb,
lib/boldsign/resources/user.rb,
lib/boldsign/resources/brand.rb,
lib/boldsign/resources/contact.rb,
lib/boldsign/resources/document.rb,
lib/boldsign/resources/template.rb,
lib/boldsign/resources/custom_field.rb,
lib/boldsign/resources/contact_group.rb,
lib/boldsign/resources/sender_identity.rb,
lib/boldsign/resources/identity_verification.rb
Overview
Top-level namespace for the BoldSign Ruby client.
Configure once at boot and access a shared Client via Boldsign.client, or instantiate Client directly when you need multiple credentials/regions.
Defined Under Namespace
Modules: CaseConvert, Resources Classes: AuthenticationError, BadRequestError, Client, ConfigurationError, Error, ForbiddenError, NotFoundError, RateLimitError, Resource, ServerError, UnprocessableEntityError
Constant Summary collapse
- REGIONS =
Region → base URL map for BoldSign’s regional API hosts.
{ us: "https://api.boldsign.com", eu: "https://api-eu.boldsign.com", ca: "https://api-ca.boldsign.com", au: "https://api-au.boldsign.com" }.freeze
- ERROR_MAP =
Maps HTTP status codes to Error subclasses.
{ 400 => BadRequestError, 401 => AuthenticationError, 403 => ForbiddenError, 404 => NotFoundError, 422 => UnprocessableEntityError, 429 => RateLimitError }.freeze
- VERSION =
"0.3.0"
Class Attribute Summary collapse
-
.api_key ⇒ String?
API key used by the shared Boldsign.client.
-
.base_url ⇒ String?
Optional explicit base URL override (takes precedence over Boldsign.region).
-
.region ⇒ Symbol?
Region key (‘:us`, `:eu`, `:ca`, `:au`).
Class Method Summary collapse
-
.client ⇒ Client
Memoized shared client built from module-level config.
-
.configure {|config| ... } ⇒ void
Yields self for block-style configuration.
-
.reset! ⇒ void
Clears the memoized shared client so the next call to Boldsign.client rebuilds it.
Class Attribute Details
.api_key ⇒ String?
Returns API key used by the shared client.
44 45 46 |
# File 'lib/boldsign.rb', line 44 def api_key @api_key end |
.base_url ⇒ String?
Returns Optional explicit base URL override (takes precedence over region).
50 51 52 |
# File 'lib/boldsign.rb', line 50 def base_url @base_url end |
.region ⇒ Symbol?
Returns Region key (‘:us`, `:eu`, `:ca`, `:au`).
47 48 49 |
# File 'lib/boldsign.rb', line 47 def region @region end |
Class Method Details
.client ⇒ Client
Returns memoized shared client built from module-level config.
60 61 62 |
# File 'lib/boldsign.rb', line 60 def client @client ||= Client.new(api_key: api_key, region: region, base_url: base_url) end |
.configure {|config| ... } ⇒ void
This method returns an undefined value.
Yields self for block-style configuration.
55 56 57 |
# File 'lib/boldsign.rb', line 55 def configure yield self end |
.reset! ⇒ void
This method returns an undefined value.
Clears the memoized shared client so the next call to client rebuilds it.
66 67 68 |
# File 'lib/boldsign.rb', line 66 def reset! @client = nil end |