Class: Rafflesia::CacheExplainData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/cache/cache_explain_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  artifact_refs: :artifact_refs,
  cache_hit_would_reuse: :cache_hit_would_reuse,
  cache_key: :cache_key,
  cache_record_path: :cache_record_path,
  cache_record_version: :cache_record_version,
  found: :found,
  manifest: :manifest,
  manifest_object: :manifest_object,
  materialization: :materialization,
  namespace: :namespace,
  operation_id: :operation_id,
  parameters: :parameters,
  reused_object_ids: :reused_object_ids,
  tool_versions: :tool_versions
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CacheExplainData

Returns a new instance of CacheExplainData.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 41

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @artifact_refs = (hash[:artifact_refs] || []).map { |item| item ? Rafflesia::ObjectRef.new(item) : nil }
  @cache_hit_would_reuse = hash[:cache_hit_would_reuse]
  @cache_key = hash[:cache_key]
  @cache_record_path = hash[:cache_record_path]
  @cache_record_version = hash[:cache_record_version]
  @found = hash[:found]
  @manifest = hash[:manifest] ? Rafflesia::MsaArtifactManifest.new(hash[:manifest]) : nil
  @manifest_object = hash[:manifest_object] ? Rafflesia::ObjectRef.new(hash[:manifest_object]) : nil
  @materialization = hash[:materialization] ? Rafflesia::CacheMaterializationExplanation.new(hash[:materialization]) : nil
  @namespace = hash[:namespace]
  @operation_id = hash[:operation_id]
  @parameters = hash[:parameters] || {}
  @reused_object_ids = (hash[:reused_object_ids] || [])
  @tool_versions = (hash[:tool_versions] || []).map { |item| item ? Rafflesia::ToolVersion.new(item) : nil }
end

Instance Attribute Details

#artifact_refsObject

Returns the value of attribute artifact_refs.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def artifact_refs
  @artifact_refs
end

#cache_hit_would_reuseObject

Returns the value of attribute cache_hit_would_reuse.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def cache_hit_would_reuse
  @cache_hit_would_reuse
end

#cache_keyObject

Returns the value of attribute cache_key.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def cache_key
  @cache_key
end

#cache_record_pathObject

Returns the value of attribute cache_record_path.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def cache_record_path
  @cache_record_path
end

#cache_record_versionObject

Returns the value of attribute cache_record_version.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def cache_record_version
  @cache_record_version
end

#foundObject

Returns the value of attribute found.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def found
  @found
end

#manifestObject

Returns the value of attribute manifest.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def manifest
  @manifest
end

#manifest_objectObject

Returns the value of attribute manifest_object.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def manifest_object
  @manifest_object
end

#materializationObject

Returns the value of attribute materialization.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def materialization
  @materialization
end

#namespaceObject

Returns the value of attribute namespace.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def namespace
  @namespace
end

#operation_idObject

Returns the value of attribute operation_id.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def operation_id
  @operation_id
end

#parametersObject

Returns the value of attribute parameters.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def parameters
  @parameters
end

#reused_object_idsObject

Returns the value of attribute reused_object_ids.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def reused_object_ids
  @reused_object_ids
end

#tool_versionsObject

Returns the value of attribute tool_versions.



25
26
27
# File 'lib/rafflesia/cache/cache_explain_data.rb', line 25

def tool_versions
  @tool_versions
end