Class: Rafflesia::ArtifactPaper
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::ArtifactPaper
- Defined in:
- lib/rafflesia/artifacts/artifact_paper.rb
Constant Summary collapse
- HASH_ATTRS =
{ artifacts: :artifacts, doi: :doi, paper_id: :paper_id, source_url: :source_url, title: :title }.freeze
Instance Attribute Summary collapse
-
#artifacts ⇒ Object
Returns the value of attribute artifacts.
-
#doi ⇒ Object
Returns the value of attribute doi.
-
#paper_id ⇒ Object
Returns the value of attribute paper_id.
-
#source_url ⇒ Object
Returns the value of attribute source_url.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(json) ⇒ ArtifactPaper
constructor
A new instance of ArtifactPaper.
Constructor Details
#initialize(json) ⇒ ArtifactPaper
Returns a new instance of ArtifactPaper.
23 24 25 26 27 28 29 30 31 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 23 def initialize(json) super() hash = self.class.normalize(json) @artifacts = (hash[:artifacts] || []).map { |item| item ? Rafflesia::PaperArtifact.new(item) : nil } @doi = hash[:doi] @paper_id = hash[:paper_id] @source_url = hash[:source_url] @title = hash[:title] end |
Instance Attribute Details
#artifacts ⇒ Object
Returns the value of attribute artifacts.
16 17 18 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 16 def artifacts @artifacts end |
#doi ⇒ Object
Returns the value of attribute doi.
16 17 18 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 16 def doi @doi end |
#paper_id ⇒ Object
Returns the value of attribute paper_id.
16 17 18 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 16 def paper_id @paper_id end |
#source_url ⇒ Object
Returns the value of attribute source_url.
16 17 18 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 16 def source_url @source_url end |
#title ⇒ Object
Returns the value of attribute title.
16 17 18 |
# File 'lib/rafflesia/artifacts/artifact_paper.rb', line 16 def title @title end |