Class: Rafflesia::ArtifactManifest

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

Constant Summary collapse

HASH_ATTRS =
{
  created_at: :created_at,
  description: :description,
  label: :label,
  manifest_id: :manifest_id,
  manifest_version: :manifest_version,
  papers: :papers,
  source: :source
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ ArtifactManifest

Returns a new instance of ArtifactManifest.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 27

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @created_at = hash[:created_at]
  @description = hash[:description]
  @label = hash[:label]
  @manifest_id = hash[:manifest_id]
  @manifest_version = hash[:manifest_version]
  @papers = (hash[:papers] || []).map { |item| item ? Rafflesia::ArtifactPaper.new(item) : nil }
  @source = hash[:source]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def description
  @description
end

#labelObject

Returns the value of attribute label.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def label
  @label
end

#manifest_idObject

Returns the value of attribute manifest_id.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def manifest_id
  @manifest_id
end

#manifest_versionObject

Returns the value of attribute manifest_version.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def manifest_version
  @manifest_version
end

#papersObject

Returns the value of attribute papers.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def papers
  @papers
end

#sourceObject

Returns the value of attribute source.



18
19
20
# File 'lib/rafflesia/artifacts/artifact_manifest.rb', line 18

def source
  @source
end