Class: Rafflesia::ObjectArtifactImportData

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/rafflesia/objects/object_artifact_import_data.rb

Constant Summary collapse

HASH_ATTRS =
{
  absolute_path: :absolute_path,
  collection: :collection,
  detected_format: :detected_format,
  file_count: :file_count,
  files: :files,
  has_required_files: :has_required_files,
  input_path: :input_path,
  manifest: :manifest,
  manifest_object: :manifest_object,
  manifest_path: :manifest_path,
  material_kind: :material_kind,
  required_sets: :required_sets,
  schema_version: :schema_version,
  storage_backends: :storage_backends,
  total_size_bytes: :total_size_bytes
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ObjectArtifactImportData

Returns a new instance of ObjectArtifactImportData.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 43

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @absolute_path = hash[:absolute_path]
  @collection = hash[:collection] ? Rafflesia::ObjectArtifactCollectionData.new(hash[:collection]) : nil
  @detected_format = hash[:detected_format]
  @file_count = hash[:file_count]
  @files = (hash[:files] || []).map { |item| item ? Rafflesia::ObjectArtifactImportedFile.new(item) : nil }
  @has_required_files = hash[:has_required_files]
  @input_path = hash[:input_path]
  @manifest = hash[:manifest] ? Rafflesia::ObjectArtifactManifestSummary.new(hash[:manifest]) : nil
  @manifest_object = hash[:manifest_object] ? Rafflesia::ObjectRef.new(hash[:manifest_object]) : nil
  @manifest_path = hash[:manifest_path]
  @material_kind = hash[:material_kind]
  @required_sets = (hash[:required_sets] || []).map { |item| item ? Rafflesia::ObjectArtifactRequiredSet.new(item) : nil }
  @schema_version = hash[:schema_version]
  @storage_backends = (hash[:storage_backends] || [])
  @total_size_bytes = hash[:total_size_bytes]
end

Instance Attribute Details

#absolute_pathObject

Returns the value of attribute absolute_path.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def absolute_path
  @absolute_path
end

#collectionObject

Returns the value of attribute collection.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def collection
  @collection
end

#detected_formatObject

Returns the value of attribute detected_format.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def detected_format
  @detected_format
end

#file_countObject

Returns the value of attribute file_count.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def file_count
  @file_count
end

#filesObject

Returns the value of attribute files.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def files
  @files
end

#has_required_filesObject

Returns the value of attribute has_required_files.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def has_required_files
  @has_required_files
end

#input_pathObject

Returns the value of attribute input_path.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def input_path
  @input_path
end

#manifestObject

Returns the value of attribute manifest.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def manifest
  @manifest
end

#manifest_objectObject

Returns the value of attribute manifest_object.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def manifest_object
  @manifest_object
end

#manifest_pathObject

Returns the value of attribute manifest_path.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def manifest_path
  @manifest_path
end

#material_kindObject

Returns the value of attribute material_kind.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def material_kind
  @material_kind
end

#required_setsObject

Returns the value of attribute required_sets.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def required_sets
  @required_sets
end

#schema_versionObject

Returns the value of attribute schema_version.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def schema_version
  @schema_version
end

#storage_backendsObject

Returns the value of attribute storage_backends.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def storage_backends
  @storage_backends
end

#total_size_bytesObject

Returns the value of attribute total_size_bytes.



26
27
28
# File 'lib/rafflesia/objects/object_artifact_import_data.rb', line 26

def total_size_bytes
  @total_size_bytes
end