Class: Rafflesia::PaperArtifact
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::PaperArtifact
- 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
-
#accession ⇒ Object
Returns the value of attribute accession.
-
#artifact_id ⇒ Object
Returns the value of attribute artifact_id.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
-
#description ⇒ Object
Returns the value of attribute description.
-
#doi ⇒ Object
Returns the value of attribute doi.
-
#format ⇒ Object
Returns the value of attribute format.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#path ⇒ Object
Returns the value of attribute path.
-
#source ⇒ Object
Returns the value of attribute source.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(json) ⇒ PaperArtifact
constructor
A new instance of PaperArtifact.
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
#accession ⇒ Object
Returns the value of attribute accession.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def accession @accession end |
#artifact_id ⇒ Object
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_type ⇒ Object
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 |
#description ⇒ Object
Returns the value of attribute description.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def description @description end |
#doi ⇒ Object
Returns the value of attribute doi.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def doi @doi end |
#format ⇒ Object
Returns the value of attribute format.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def format @format end |
#kind ⇒ Object
Returns the value of attribute kind.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def kind @kind end |
#metadata ⇒ Object
Returns the value of attribute metadata.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def @metadata end |
#path ⇒ Object
Returns the value of attribute path.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def path @path end |
#source ⇒ Object
Returns the value of attribute source.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def source @source end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/rafflesia/artifacts/paper_artifact.rb', line 22 def url @url end |