Class: Retab::ExperimentMetricsStaleError

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb

Constant Summary collapse

HASH_ATTRS =
{
  kind: :kind,
  error: :error,
  experiment_id: :experiment_id,
  stale_reasons: :stale_reasons,
  last_run: :last_run,
  current_config_fingerprint: :current_config_fingerprint,
  message: :message
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ExperimentMetricsStaleError

Returns a new instance of ExperimentMetricsStaleError.



27
28
29
30
31
32
33
34
35
36
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 27

def initialize(json)
  hash = self.class.normalize(json)
  @kind = hash[:kind]
  @error = hash[:error]
  @experiment_id = hash[:experiment_id]
  @stale_reasons = (hash[:stale_reasons] || [])
  @last_run = hash[:last_run] ? Retab::MetricsStaleErrorLastRun.new(hash[:last_run]) : nil
  @current_config_fingerprint = hash[:current_config_fingerprint]
  @message = hash[:message]
end

Instance Attribute Details

#current_config_fingerprintObject

Returns the value of attribute current_config_fingerprint.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def current_config_fingerprint
  @current_config_fingerprint
end

#errorObject

Returns the value of attribute error.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def error
  @error
end

#experiment_idObject

Returns the value of attribute experiment_id.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def experiment_id
  @experiment_id
end

#kindObject

Returns the value of attribute kind.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def kind
  @kind
end

#last_runObject

Returns the value of attribute last_run.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def last_run
  @last_run
end

#messageObject

Returns the value of attribute message.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def message
  @message
end

#stale_reasonsObject

Returns the value of attribute stale_reasons.



18
19
20
# File 'lib/retab/experiment_run_metrics/experiment_metrics_stale_error.rb', line 18

def stale_reasons
  @stale_reasons
end