Class: Feat::EvalContext
- Inherits:
-
Struct
- Object
- Struct
- Feat::EvalContext
- Defined in:
- lib/feat/context.rb
Overview
SDK-consumer-supplied context. Mirrors OpenFeature’s pattern: a ‘targeting_key` shorthand for “user.key”, and a `kinds` hash whose keys match the datafile’s ‘contextKinds` map.
Example:
Feat::EvalContext.new(
targeting_key: "user-123",
kinds: {
"user" => { "key" => "user-123", "email" => "u@example.com" },
"organization" => { "key" => "acme", "plan" => "pro" }
}
)
Instance Attribute Summary collapse
-
#kinds ⇒ Object
Returns the value of attribute kinds.
-
#targeting_key ⇒ Object
Returns the value of attribute targeting_key.
Instance Method Summary collapse
-
#initialize(targeting_key: nil, kinds: {}) ⇒ EvalContext
constructor
A new instance of EvalContext.
Constructor Details
#initialize(targeting_key: nil, kinds: {}) ⇒ EvalContext
Returns a new instance of EvalContext.
16 17 18 |
# File 'lib/feat/context.rb', line 16 def initialize(targeting_key: nil, kinds: {}) super end |
Instance Attribute Details
#kinds ⇒ Object
Returns the value of attribute kinds
15 16 17 |
# File 'lib/feat/context.rb', line 15 def kinds @kinds end |
#targeting_key ⇒ Object
Returns the value of attribute targeting_key
15 16 17 |
# File 'lib/feat/context.rb', line 15 def targeting_key @targeting_key end |