Class: Rafflesia::PaperArtifact

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

Constant Summary collapse

HASH_ATTRS =
{
  accession: :accession,
  artifact_id: :artifact_id,
  content_type: :content_type,
  description: :description,
  doi: :doi,
  format: :format,
  kind: :kind,
  metadata: :metadata,
  path: :path,
  source: :source,
  url: :url
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ PaperArtifact

Returns a new instance of PaperArtifact.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 35

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @accession = hash[:accession]
  @artifact_id = hash[:artifact_id]
  @content_type = hash[:content_type]
  @description = hash[:description]
  @doi = hash[:doi]
  @format = hash[:format]
  @kind = hash[:kind]
  @metadata = hash[:metadata] || {}
  @path = hash[:path]
  @source = hash[:source]
  @url = hash[:url]
end

Instance Attribute Details

#accessionObject

Returns the value of attribute accession.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def accession
  @accession
end

#artifact_idObject

Returns the value of attribute artifact_id.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def artifact_id
  @artifact_id
end

#content_typeObject

Returns the value of attribute content_type.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def content_type
  @content_type
end

#descriptionObject

Returns the value of attribute description.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def description
  @description
end

#doiObject

Returns the value of attribute doi.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def doi
  @doi
end

#formatObject

Returns the value of attribute format.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def format
  @format
end

#kindObject

Returns the value of attribute kind.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def kind
  @kind
end

#metadataObject

Returns the value of attribute metadata.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def 
  @metadata
end

#pathObject

Returns the value of attribute path.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def path
  @path
end

#sourceObject

Returns the value of attribute source.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def source
  @source
end

#urlObject

Returns the value of attribute url.



22
23
24
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22

def url
  @url
end