Class: Conexa::Configuration
Constant Summary collapse
- TRUTHY =
Values that turn read-only mode on via CONEXA_READ_ONLY.
%w[1 true yes on].freeze
- FALSEY =
Values that explicitly turn it off. Anything else is a typo worth warning about — silently failing open on
CONEXA_READ_ONLY=treuwould leave an operator believing writes were blocked when they are not. %w[0 false no off].freeze
Instance Attribute Summary collapse
-
#api_host ⇒ String
The tenant base URL, e.g.
-
#api_token ⇒ String
The Application Token, created in Conexa under Config > Integrações > API / Token.
-
#read_only ⇒ Boolean
When true, any request other than GET raises ReadOnlyError before reaching the network.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 |
# File 'lib/conexa/configuration.rb', line 24 def initialize @api_token = '' @api_host = '' @read_only = nil end |
Instance Attribute Details
#api_host ⇒ String
Returns the tenant base URL, e.g. "https://mycompany.conexa.app".
10 11 12 |
# File 'lib/conexa/configuration.rb', line 10 def api_host @api_host end |
#api_token ⇒ String
Returns the Application Token, created in Conexa under Config > Integrações > API / Token.
7 8 9 |
# File 'lib/conexa/configuration.rb', line 7 def api_token @api_token end |
#read_only ⇒ Boolean
When true, any request other than GET raises ReadOnlyError before reaching the network.
Read lazily so that CONEXA_READ_ONLY still applies when it is set after Conexa.configure has run — it used to be captured once at initialization, which made setting it later a silent no-op. An explicit assignment always wins over the environment.
39 40 41 42 43 |
# File 'lib/conexa/configuration.rb', line 39 def read_only return @read_only unless @read_only.nil? env_read_only end |