Class: Featureflip::Models::EvaluationEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/featureflip/models/evaluation_event.rb

Overview

The payload handed to every registered evaluation inspector, once per variation call. This is the frozen cross-SDK inspector contract (see docs/superpowers/specs/2026-07-13-sdk-onevaluation-inspector-design.md), spelled in Ruby snake_case:

flag_key         the flag key evaluated
context          the full evaluation context -- a copy, so mutating it
               cannot affect the caller's hash
value            the value the caller actually receives (default applied)
variation_key    winning arm; nil on flag-not-found and on error
reason           this SDK's native reason string (PascalCase, matching
               EvaluationDetail#reason -- deliberately NOT converted)
rule_id          set only on a rule match
prerequisite_key set only on a prerequisite failure
timestamp        ISO-8601 string

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flag_key:, context:, value:, reason:, timestamp:, variation_key: nil, rule_id: nil, prerequisite_key: nil) ⇒ EvaluationEvent

Returns a new instance of EvaluationEvent.



23
24
25
26
# File 'lib/featureflip/models/evaluation_event.rb', line 23

def initialize(flag_key:, context:, value:, reason:, timestamp:,
               variation_key: nil, rule_id: nil, prerequisite_key: nil)
  super
end

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def context
  @context
end

#flag_keyObject

Returns the value of attribute flag_key

Returns:

  • (Object)

    the current value of flag_key



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def flag_key
  @flag_key
end

#prerequisite_keyObject

Returns the value of attribute prerequisite_key

Returns:

  • (Object)

    the current value of prerequisite_key



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def prerequisite_key
  @prerequisite_key
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def reason
  @reason
end

#rule_idObject

Returns the value of attribute rule_id

Returns:

  • (Object)

    the current value of rule_id



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def rule_id
  @rule_id
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def timestamp
  @timestamp
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def value
  @value
end

#variation_keyObject

Returns the value of attribute variation_key

Returns:

  • (Object)

    the current value of variation_key



18
19
20
# File 'lib/featureflip/models/evaluation_event.rb', line 18

def variation_key
  @variation_key
end