Class: Rafflesia::ArtifactManifestImportData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/artifacts/artifact_manifest_import_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  artifact_count: :artifact_count,
  external_reference_count: :external_reference_count,
  failure_count: :failure_count,
  imported_structure_count: :imported_structure_count,
  manifest: :manifest,
  manifest_id: :manifest_id,
  manifest_object: :manifest_object,
  manifest_path: :manifest_path,
  paper_count: :paper_count,
  results: :results
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ArtifactManifestImportData

Returns a new instance of ArtifactManifestImportData.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 33

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @artifact_count = hash[:artifact_count]
  @external_reference_count = hash[:external_reference_count]
  @failure_count = hash[:failure_count]
  @imported_structure_count = hash[:imported_structure_count]
  @manifest = hash[:manifest] ? Rafflesia::ArtifactManifest.new(hash[:manifest]) : nil
  @manifest_id = hash[:manifest_id]
  @manifest_object = hash[:manifest_object] ? Rafflesia::ObjectRef.new(hash[:manifest_object]) : nil
  @manifest_path = hash[:manifest_path]
  @paper_count = hash[:paper_count]
  @results = (hash[:results] || []).map { |item| item ? Rafflesia::ArtifactImportResult.new(item) : nil }
end

Instance Attribute Details

#artifact_countObject

Returns the value of attribute artifact_count.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def artifact_count
  @artifact_count
end

#external_reference_countObject

Returns the value of attribute external_reference_count.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def external_reference_count
  @external_reference_count
end

#failure_countObject

Returns the value of attribute failure_count.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def failure_count
  @failure_count
end

#imported_structure_countObject

Returns the value of attribute imported_structure_count.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def imported_structure_count
  @imported_structure_count
end

#manifestObject

Returns the value of attribute manifest.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def manifest
  @manifest
end

#manifest_idObject

Returns the value of attribute manifest_id.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def manifest_id
  @manifest_id
end

#manifest_objectObject

Returns the value of attribute manifest_object.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def manifest_object
  @manifest_object
end

#manifest_pathObject

Returns the value of attribute manifest_path.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def manifest_path
  @manifest_path
end

#paper_countObject

Returns the value of attribute paper_count.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def paper_count
  @paper_count
end

#resultsObject

Returns the value of attribute results.



21
22
23
# File 'lib/rafflesia/artifacts/artifact_manifest_import_data.rb', line 21

def results
  @results
end