Class: ConfigCat::EvaluationDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/configcat/evaluationdetails.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, value:, variation_id: nil, fetch_time: nil, user: nil, is_default_value: false, error: nil, matched_evaluation_rule: nil, matched_evaluation_percentage_rule: nil) ⇒ EvaluationDetails

Returns a new instance of EvaluationDetails.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/configcat/evaluationdetails.rb', line 6

def initialize(key:, value:, variation_id: nil, fetch_time: nil, user: nil, is_default_value: false, error: nil,
               matched_evaluation_rule: nil, matched_evaluation_percentage_rule: nil)
  @key = key
  @value = value
  @variation_id = variation_id
  @fetch_time = fetch_time
  @user = user
  @is_default_value = is_default_value
  @error = error
  @matched_evaluation_rule = matched_evaluation_rule
  @matched_evaluation_percentage_rule = matched_evaluation_percentage_rule
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def error
  @error
end

#fetch_timeObject (readonly)

Returns the value of attribute fetch_time.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def fetch_time
  @fetch_time
end

#is_default_valueObject (readonly)

Returns the value of attribute is_default_value.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def is_default_value
  @is_default_value
end

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def key
  @key
end

#matched_evaluation_percentage_ruleObject (readonly)

Returns the value of attribute matched_evaluation_percentage_rule.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def matched_evaluation_percentage_rule
  @matched_evaluation_percentage_rule
end

#matched_evaluation_ruleObject (readonly)

Returns the value of attribute matched_evaluation_rule.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def matched_evaluation_rule
  @matched_evaluation_rule
end

#userObject (readonly)

Returns the value of attribute user.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def user
  @user
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def value
  @value
end

#variation_idObject (readonly)

Returns the value of attribute variation_id.



3
4
5
# File 'lib/configcat/evaluationdetails.rb', line 3

def variation_id
  @variation_id
end

Class Method Details

.from_error(key, value, error:, variation_id: nil) ⇒ Object



19
20
21
# File 'lib/configcat/evaluationdetails.rb', line 19

def self.from_error(key, value, error:, variation_id: nil)
  EvaluationDetails.new(key: key, value: value, variation_id: variation_id, is_default_value: true, error: error)
end