Module: Equipoise
- Defined in:
- lib/equipoise/util.rb,
lib/equipoise.rb,
lib/equipoise/client.rb,
lib/equipoise/errors.rb,
lib/equipoise/railtie.rb,
lib/equipoise/version.rb,
lib/equipoise/contacts.rb,
lib/equipoise/response.rb,
lib/equipoise/syncable.rb,
lib/equipoise/batch_result.rb,
lib/equipoise/configuration.rb,
lib/equipoise/custom_fields.rb,
lib/generators/equipoise/install_generator.rb
Overview
=============================================================================
Equipoise::CustomFields
Manage a producer's typed custom-field definitions (the schema the producer
owns). Values themselves ride along on a contact sync via
custom_fields: { key: value }; this resource is for declaring/inspecting the
field definitions up front.
declare(key:, field_type:, options:, source:) → POST /custom_fields (upsert)
list(customizable_type:) → GET /custom_fields
get(key) → GET /custom_fields/:key
update(key, label:, …) → PATCH /custom_fields/:key
delete(key, purge_values:) → DELETE /custom_fields/:key
Used by: Equipoise::Client#custom_fields
Defined Under Namespace
Modules: Generators, Syncable, Util Classes: ApiError, AuthenticationError, BatchResult, Client, Configuration, ConfigurationError, ConflictError, ConnectionError, Contacts, CustomFields, Error, ForbiddenError, NotFoundError, Railtie, RateLimitError, Response, ServerError, ValidationError
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.client ⇒ Object
— Claude authored — memoized default client.
-
.configuration ⇒ Object
— Claude (External CRM Sync, S12): the process-wide configuration.
- .configure {|configuration| ... } ⇒ Object
- .configured? ⇒ Boolean
-
.disable! ⇒ Object
— Claude authored (#5) — test-mode kill switch.
- .disabled? ⇒ Boolean
- .enable! ⇒ Object
-
.reset! ⇒ Object
— Claude authored — reset global state (used by the test suite's before hook; also handy in a console).
Class Method Details
.client ⇒ Object
— Claude authored — memoized default client. Most callers use this; tests and multi-tenant producers build their own Client with an explicit config.
57 58 59 |
# File 'lib/equipoise.rb', line 57 def client @client ||= Client.new(configuration) end |
.configuration ⇒ Object
— Claude (External CRM Sync, S12): the process-wide configuration. Built
lazily from ENV so a bare require "equipoise" is side-effect-free.
45 46 47 |
# File 'lib/equipoise.rb', line 45 def configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
49 50 51 52 53 |
# File 'lib/equipoise.rb', line 49 def configure yield(configuration) if block_given? @client = nil # a re-configure invalidates the memoized client configuration end |
.configured? ⇒ Boolean
61 62 63 |
# File 'lib/equipoise.rb', line 61 def configured? !configuration.api_key.to_s.empty? end |
.disable! ⇒ Object
— Claude authored (#5) — test-mode kill switch. Put Equipoise.disable! in
a producer's rails_helper (or set test env) so no spec can make a live call
even if EQUIPOISE_API_KEY leaks into the environment. Calls become no-ops
returning a benign Response.
69 70 71 |
# File 'lib/equipoise.rb', line 69 def disable! configuration.enabled = false end |
.disabled? ⇒ Boolean
77 78 79 |
# File 'lib/equipoise.rb', line 77 def disabled? configuration.disabled? end |
.enable! ⇒ Object
73 74 75 |
# File 'lib/equipoise.rb', line 73 def enable! configuration.enabled = true end |
.reset! ⇒ Object
— Claude authored — reset global state (used by the test suite's before hook; also handy in a console).
83 84 85 86 |
# File 'lib/equipoise.rb', line 83 def reset! @configuration = nil @client = nil end |