Class: Lucerna::Config
- Inherits:
-
Object
- Object
- Lucerna::Config
- Defined in:
- lib/lucerna/config.rb
Overview
Configuration for the module-level singletons. Set via Lucerna.configure before the first use of Lucerna.gates / Lucerna.identity.
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Defaults to https://api.uselucerna.app.
-
#eager_init ⇒ Object
Warm Lucerna.gates after Rails boot instead of on first read.
-
#identity_key ⇒ Object
Key for Lucerna.identity; defaults to server_key.
-
#logger ⇒ Object
Used at :warn when on_error is not set.
-
#on_error ⇒ Object
callable(Error) — failures from polling and delivery.
-
#refresh_interval ⇒ Object
Runtime poll cadence in seconds.
-
#request_timeout ⇒ Object
Per-request timeout in seconds.
-
#server_key ⇒ Object
Required for Lucerna.gates: a server key (ck_srv_… / ck_key_…).
-
#track_exposures ⇒ Object
Record experiment exposures on variant reads.
-
#transport ⇒ Object
Injectable transport (test seam): responds to call(request, timeout:).
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
32 33 34 35 |
# File 'lib/lucerna/config.rb', line 32 def initialize @track_exposures = true @eager_init = false end |
Instance Attribute Details
#base_url ⇒ Object
Defaults to https://api.uselucerna.app.
11 12 13 |
# File 'lib/lucerna/config.rb', line 11 def base_url @base_url end |
#eager_init ⇒ Object
Warm Lucerna.gates after Rails boot instead of on first read. Default false — lazy init is fork-safe by construction.
30 31 32 |
# File 'lib/lucerna/config.rb', line 30 def eager_init @eager_init end |
#identity_key ⇒ Object
Key for Lucerna.identity; defaults to server_key. Any key granted people:identify works.
25 26 27 |
# File 'lib/lucerna/config.rb', line 25 def identity_key @identity_key end |
#logger ⇒ Object
Used at :warn when on_error is not set. The Railtie defaults this to Rails.logger.
20 21 22 |
# File 'lib/lucerna/config.rb', line 20 def logger @logger end |
#on_error ⇒ Object
callable(Error) — failures from polling and delivery. Reads never raise.
17 18 19 |
# File 'lib/lucerna/config.rb', line 17 def on_error @on_error end |
#refresh_interval ⇒ Object
Runtime poll cadence in seconds. Default 10, floored at 1.
13 14 15 |
# File 'lib/lucerna/config.rb', line 13 def refresh_interval @refresh_interval end |
#request_timeout ⇒ Object
Per-request timeout in seconds. Default 5.
15 16 17 |
# File 'lib/lucerna/config.rb', line 15 def request_timeout @request_timeout end |
#server_key ⇒ Object
Required for Lucerna.gates: a server key (ck_srv_… / ck_key_…).
9 10 11 |
# File 'lib/lucerna/config.rb', line 9 def server_key @server_key end |
#track_exposures ⇒ Object
Record experiment exposures on variant reads. Default true.
22 23 24 |
# File 'lib/lucerna/config.rb', line 22 def track_exposures @track_exposures end |
#transport ⇒ Object
Injectable transport (test seam): responds to call(request, timeout:).
27 28 29 |
# File 'lib/lucerna/config.rb', line 27 def transport @transport end |