Class: Statsig::EvaluationDetails

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_sync_time, init_time, reason) ⇒ EvaluationDetails

Returns a new instance of EvaluationDetails.



20
21
22
23
24
25
# File 'lib/evaluation_details.rb', line 20

def initialize(config_sync_time, init_time, reason)
  @config_sync_time = config_sync_time
  @init_time = init_time
  @reason = reason
  @server_time = (Time.now.to_i * 1000).to_s
end

Instance Attribute Details

#config_sync_timeObject

Returns the value of attribute config_sync_time.



15
16
17
# File 'lib/evaluation_details.rb', line 15

def config_sync_time
  @config_sync_time
end

#init_timeObject

Returns the value of attribute init_time.



16
17
18
# File 'lib/evaluation_details.rb', line 16

def init_time
  @init_time
end

#reasonObject

Returns the value of attribute reason.



17
18
19
# File 'lib/evaluation_details.rb', line 17

def reason
  @reason
end

#server_timeObject

Returns the value of attribute server_time.



18
19
20
# File 'lib/evaluation_details.rb', line 18

def server_time
  @server_time
end

Class Method Details

.local_override(config_sync_time, init_time) ⇒ Object



43
44
45
# File 'lib/evaluation_details.rb', line 43

def self.local_override(config_sync_time, init_time)
  EvaluationDetails.new(config_sync_time, init_time, EvaluationReason::LOCAL_OVERRIDE)
end

.network(config_sync_time, init_time) ⇒ Object



39
40
41
# File 'lib/evaluation_details.rb', line 39

def self.network(config_sync_time, init_time)
  EvaluationDetails.new(config_sync_time, init_time, EvaluationReason::NETWORK)
end

.persisted(config_sync_time, init_time) ⇒ Object



47
48
49
# File 'lib/evaluation_details.rb', line 47

def self.persisted(config_sync_time, init_time)
  EvaluationDetails.new(config_sync_time, init_time, EvaluationReason::PERSISTED)
end

.uninitializedObject



35
36
37
# File 'lib/evaluation_details.rb', line 35

def self.uninitialized
  EvaluationDetails.new(0, 0, EvaluationReason::UNINITIALIZED)
end

.unrecognized(config_sync_time, init_time) ⇒ Object



31
32
33
# File 'lib/evaluation_details.rb', line 31

def self.unrecognized(config_sync_time, init_time)
  EvaluationDetails.new(config_sync_time, init_time, EvaluationReason::UNRECOGNIZED)
end

.unsupported(config_sync_time, init_time) ⇒ Object



27
28
29
# File 'lib/evaluation_details.rb', line 27

def self.unsupported(config_sync_time, init_time)
  EvaluationDetails.new(config_sync_time, init_time, EvaluationReason::UNSUPPORTED)
end