Class: PostHog::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.



47
48
49
50
51
52
# File 'lib/posthog/feature_flag.rb', line 47

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.



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

def code
  @code
end

#condition_indexObject (readonly)

Returns the value of attribute condition_index.



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

def condition_index
  @condition_index
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end