Class: Shipeasy::Configuration
- Inherits:
-
Object
- Object
- Shipeasy::Configuration
- Defined in:
- lib/shipeasy/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
—- experimentation / SDK —-.
-
#attributes ⇒ Object
Optional transform from YOUR user object (any shape) to the Shipeasy attribute hash every flag/experiment evaluation uses.
-
#base_url ⇒ Object
—- experimentation / SDK —-.
-
#cdn_base_url ⇒ Object
—- i18n / string manager —-.
-
#default_chunk ⇒ Object
—- i18n / string manager —-.
-
#disable_telemetry ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves: - env (default “prod”): deployment tag on see() events + usage telemetry.
-
#env ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves: - env (default “prod”): deployment tag on see() events + usage telemetry.
-
#http_timeout ⇒ Object
—- i18n / string manager —-.
-
#init ⇒ Object
Fetch lifecycle for the global engine ‘configure` builds: - init (default true): fire a one-shot fetch fire-and-forget so the first `Shipeasy::Client.new(user).get_flag(…)` resolves against real rules (ideal for serverless / short-lived processes).
-
#label_file_cache_ttl ⇒ Object
—- i18n / string manager —-.
-
#loader_url ⇒ Object
—- i18n / string manager —-.
-
#manifest_cache_ttl ⇒ Object
—- i18n / string manager —-.
-
#poll ⇒ Object
Fetch lifecycle for the global engine ‘configure` builds: - init (default true): fire a one-shot fetch fire-and-forget so the first `Shipeasy::Client.new(user).get_flag(…)` resolves against real rules (ideal for serverless / short-lived processes).
-
#private_attributes ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves: - env (default “prod”): deployment tag on see() events + usage telemetry.
-
#profile ⇒ Object
—- i18n / string manager —-.
-
#public_key ⇒ Object
—- i18n / string manager —-.
-
#sticky_store ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves: - env (default “prod”): deployment tag on see() events + usage telemetry.
-
#telemetry_url ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves: - env (default “prod”): deployment tag on see() events + usage telemetry.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/shipeasy/config.rb', line 63 def initialize @base_url = "https://edge.shipeasy.dev" @attributes = nil @init = true @poll = false @env = "prod" @disable_telemetry = false @telemetry_url = nil @private_attributes = nil @sticky_store = nil @profile = "default" @default_chunk = "index" @cdn_base_url = "https://cdn.i18n.shipeasy.ai" @loader_url = "https://cdn.i18n.shipeasy.ai/loader.js" @manifest_cache_ttl = 60 @label_file_cache_ttl = 3600 @http_timeout = 1 end |
Instance Attribute Details
#api_key ⇒ Object
—- experimentation / SDK —-
23 24 25 |
# File 'lib/shipeasy/config.rb', line 23 def api_key @api_key end |
#attributes ⇒ Object
Optional transform from YOUR user object (any shape) to the Shipeasy attribute hash every flag/experiment evaluation uses. A callable (lambda/proc or anything responding to #call). Default = identity (the user object is assumed to already BE the attribute hash). Runs once, in the Shipeasy::Client constructor.
Shipeasy.configure do |c|
c.api_key = ENV["SHIPEASY_SERVER_KEY"]
c.attributes = ->(u) { { "user_id" => u.id, "plan" => u.plan } }
end
56 57 58 |
# File 'lib/shipeasy/config.rb', line 56 def attributes @attributes end |
#base_url ⇒ Object
—- experimentation / SDK —-
23 24 25 |
# File 'lib/shipeasy/config.rb', line 23 def base_url @base_url end |
#cdn_base_url ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def cdn_base_url @cdn_base_url end |
#default_chunk ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def default_chunk @default_chunk end |
#disable_telemetry ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves:
- env (default "prod"): deployment tag on see() events + usage telemetry.
- disable_telemetry (default false): opt out of per-eval usage telemetry.
- telemetry_url: override the telemetry endpoint (rarely needed).
- private_attributes: attribute keys stripped from every outbound event
before it leaves the process (they still drive targeting locally).
- sticky_store: pin a user's experiment group across re-buckets.
33 34 35 |
# File 'lib/shipeasy/config.rb', line 33 def disable_telemetry @disable_telemetry end |
#env ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves:
- env (default "prod"): deployment tag on see() events + usage telemetry.
- disable_telemetry (default false): opt out of per-eval usage telemetry.
- telemetry_url: override the telemetry endpoint (rarely needed).
- private_attributes: attribute keys stripped from every outbound event
before it leaves the process (they still drive targeting locally).
- sticky_store: pin a user's experiment group across re-buckets.
33 34 35 |
# File 'lib/shipeasy/config.rb', line 33 def env @env end |
#http_timeout ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def http_timeout @http_timeout end |
#init ⇒ Object
Fetch lifecycle for the global engine ‘configure` builds:
- init (default true): fire a one-shot fetch fire-and-forget so the first
`Shipeasy::Client.new(user).get_flag(...)` resolves against real rules
(ideal for serverless / short-lived processes).
- poll (default false): start the background poll (initial fetch +
periodic refresh) for a long-running server, so flags stay fresh
without a redeploy. Configuration owns the lifecycle — you never call
`engine.init` yourself.
44 45 46 |
# File 'lib/shipeasy/config.rb', line 44 def init @init end |
#label_file_cache_ttl ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def label_file_cache_ttl @label_file_cache_ttl end |
#loader_url ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def loader_url @loader_url end |
#manifest_cache_ttl ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def manifest_cache_ttl @manifest_cache_ttl end |
#poll ⇒ Object
Fetch lifecycle for the global engine ‘configure` builds:
- init (default true): fire a one-shot fetch fire-and-forget so the first
`Shipeasy::Client.new(user).get_flag(...)` resolves against real rules
(ideal for serverless / short-lived processes).
- poll (default false): start the background poll (initial fetch +
periodic refresh) for a long-running server, so flags stay fresh
without a redeploy. Configuration owns the lifecycle — you never call
`engine.init` yourself.
44 45 46 |
# File 'lib/shipeasy/config.rb', line 44 def poll @poll end |
#private_attributes ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves:
- env (default "prod"): deployment tag on see() events + usage telemetry.
- disable_telemetry (default false): opt out of per-eval usage telemetry.
- telemetry_url: override the telemetry endpoint (rarely needed).
- private_attributes: attribute keys stripped from every outbound event
before it leaves the process (they still drive targeting locally).
- sticky_store: pin a user's experiment group across re-buckets.
33 34 35 |
# File 'lib/shipeasy/config.rb', line 33 def private_attributes @private_attributes end |
#profile ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def profile @profile end |
#public_key ⇒ Object
—- i18n / string manager —-
59 60 61 |
# File 'lib/shipeasy/config.rb', line 59 def public_key @public_key end |
#sticky_store ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves:
- env (default "prod"): deployment tag on see() events + usage telemetry.
- disable_telemetry (default false): opt out of per-eval usage telemetry.
- telemetry_url: override the telemetry endpoint (rarely needed).
- private_attributes: attribute keys stripped from every outbound event
before it leaves the process (they still drive targeting locally).
- sticky_store: pin a user's experiment group across re-buckets.
33 34 35 |
# File 'lib/shipeasy/config.rb', line 33 def sticky_store @sticky_store end |
#telemetry_url ⇒ Object
Advanced ‘configure` options — threaded into the global Engine `configure` builds, so callers never construct an Engine themselves:
- env (default "prod"): deployment tag on see() events + usage telemetry.
- disable_telemetry (default false): opt out of per-eval usage telemetry.
- telemetry_url: override the telemetry endpoint (rarely needed).
- private_attributes: attribute keys stripped from every outbound event
before it leaves the process (they still drive targeting locally).
- sticky_store: pin a user's experiment group across re-buckets.
33 34 35 |
# File 'lib/shipeasy/config.rb', line 33 def telemetry_url @telemetry_url end |