Class: EvaluationReason

Inherits:
Object
  • Object
show all
Defined in:
lib/posthog/feature_flag.rb

Overview

Represents the reason why a flag was enabled/disabled

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ EvaluationReason

Returns a new instance of EvaluationReason.



42
43
44
45
46
47
# File 'lib/posthog/feature_flag.rb', line 42

def initialize(json)
  json.transform_keys!(&:to_s)
  @code = json["code"]
  @description = json["description"]
  @condition_index = json["condition_index"]&.to_i if json["condition_index"]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



40
41
42
# File 'lib/posthog/feature_flag.rb', line 40

def code
  @code
end

#condition_indexObject (readonly)

Returns the value of attribute condition_index.



40
41
42
# File 'lib/posthog/feature_flag.rb', line 40

def condition_index
  @condition_index
end

#descriptionObject (readonly)

Returns the value of attribute description.



40
41
42
# File 'lib/posthog/feature_flag.rb', line 40

def description
  @description
end