Class: PostHog::EvaluationReason Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents the reason why a flag was enabled/disabled.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ EvaluationReason

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EvaluationReason.

Parameters:

  • json (Hash)

    Raw reason data returned by /flags.



59
60
61
62
63
64
# File 'lib/posthog/feature_flag.rb', line 59

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)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/posthog/feature_flag.rb', line 56

def code
  @code
end

#condition_indexObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/posthog/feature_flag.rb', line 56

def condition_index
  @condition_index
end

#descriptionObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



56
57
58
# File 'lib/posthog/feature_flag.rb', line 56

def description
  @description
end