Class: Shipeasy::Engine
- Inherits:
-
Object
- Object
- Shipeasy::Engine
- Defined in:
- lib/shipeasy/engine.rb
Overview
The heavyweight engine: owns the api key, HTTP transport, the blob cache,
the background poll timer, init/init_once, local overrides, track, and
see()/default-client wiring. Was Shipeasy::SDK::FlagsClient before 2.0;
renamed to a clean top-level Shipeasy::Engine when the lightweight
user-bound Shipeasy::Client became the primary front door.
Most apps never construct an Engine directly — Shipeasy.configure { … }
builds and registers the one global engine for you. Construct one explicitly
only for advanced/serverless flows (multiple keys, offline snapshots).
Defined Under Namespace
Classes: FlagDetail
Constant Summary collapse
- Eval =
Internal collaborators still live under Shipeasy::SDK; alias them so the body below can keep referring to them unqualified after the class moved out from under the SDK namespace.
Shipeasy::SDK::Eval
- Telemetry =
Shipeasy::SDK::Telemetry
- AnonId =
Shipeasy::SDK::AnonId
- See =
Shipeasy::SDK::See
- DEFAULT_BASE_URL =
"https://edge.shipeasy.dev"- DEFAULT_CDN_BASE =
CDN origin serving the static loader scripts (/sdk/bootstrap.js, /sdk/i18n/loader.js) — distinct from the edge API the blobs are fetched from.
"https://cdn.shipeasy.ai"- REASON_CLIENT_NOT_READY =
Reason constants for FlagDetail#reason / get_flag_detail.
"CLIENT_NOT_READY"- REASON_FLAG_NOT_FOUND =
no blob fetched/loaded yet
"FLAG_NOT_FOUND"- REASON_OFF =
blob present, gate absent
"OFF"- REASON_OVERRIDE =
gate present but disabled/killed
"OVERRIDE"- REASON_RULE_MATCH =
answered by a local override
"RULE_MATCH"- REASON_DEFAULT =
evaluated true
"DEFAULT"
Class Method Summary collapse
-
.for_testing(env: "prod") ⇒ Object
Build a no-network, immediately-usable client for tests.
-
.from_file(path, env: "prod") ⇒ Object
Build an offline client from a JSON snapshot file.
-
.from_snapshot(flags: nil, experiments: nil, env: "prod") ⇒ Object
Build an offline client directly from already-parsed blobs (same shape as the /sdk/flags and /sdk/experiments response bodies).
Instance Method Summary collapse
-
#bind_attributes(user) ⇒ Object
Public hook for the bound Shipeasy::Client: normalise an attribute hash and apply the request-scoped anonymous_id merge ONCE, at Client construction, exactly as every per-call getter does internally.
-
#bootstrap_script_tag(user, anon_id: nil, i18n_profile: "en:prod", base_url: nil) ⇒ Object
Return the cross-platform SSR bootstrap