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.



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

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.



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

def code
  @code
end

#condition_indexObject (readonly)

Returns the value of attribute condition_index.



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

def condition_index
  @condition_index
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end