Class: Retab::ArtifactDrift

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_experiments/artifact_drift.rb

Constant Summary collapse

HASH_ATTRS =
{
  status: :status,
  affected_targets: :affected_targets,
  detail: :detail
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ArtifactDrift

Returns a new instance of ArtifactDrift.



20
21
22
23
24
25
26
# File 'lib/retab/workflow_experiments/artifact_drift.rb', line 20

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @status = hash[:status].nil? ? "unknown" : hash[:status]
  @affected_targets = (hash[:affected_targets] || [])
  @detail = hash[:detail]
end

Instance Attribute Details

#affected_targetsObject

Returns the value of attribute affected_targets.



14
15
16
# File 'lib/retab/workflow_experiments/artifact_drift.rb', line 14

def affected_targets
  @affected_targets
end

#detailObject

Returns the value of attribute detail.



14
15
16
# File 'lib/retab/workflow_experiments/artifact_drift.rb', line 14

def detail
  @detail
end

#statusObject

Returns the value of attribute status.



14
15
16
# File 'lib/retab/workflow_experiments/artifact_drift.rb', line 14

def status
  @status
end