Class: BEL::Model::Citation
- Inherits:
-
Struct
- Object
- Struct
- BEL::Model::Citation
- Defined in:
- lib/bel/evidence_model/citation.rb
Overview
A Citation provides a reference to the resource containing the Evidence information. The fields are defined as:
-
date
-
The date represents when the article was published.
-
-
authors
-
The authors refer to the authors of the article.
-
Instance Attribute Summary collapse
-
#authors ⇒ String
the authors of the article.
-
#comment ⇒ String
a comment on the citation.
-
#date ⇒ String
the date when the article was published.
-
#id ⇒ String
the identifier of the article.
-
#name ⇒ String
the name of the article.
-
#type ⇒ String
the type of the article commonly defined by “PubMed”, “Journal”, “Book”, or “Online Resource”.
Class Method Summary collapse
-
.create(fields = {}) ⇒ Object
Creates a Citation struct from a
Hash
.
Instance Method Summary collapse
Instance Attribute Details
#authors ⇒ String
the authors of the article
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def @authors end |
#comment ⇒ String
a comment on the citation
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def comment @comment end |
#date ⇒ String
the date when the article was published
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def date @date end |
#id ⇒ String
the identifier of the article. For example, for a “PubMed” type the identifier is the PMID (i.e. 12102192)
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def id @id end |
#name ⇒ String
the name of the article
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def name @name end |
#type ⇒ String
the type of the article commonly defined by “PubMed”, “Journal”, “Book”, or “Online Resource”
20 21 22 |
# File 'lib/bel/evidence_model/citation.rb', line 20 def type @type end |
Class Method Details
.create(fields = {}) ⇒ Object
Creates a BEL::Model::Citation struct from a Hash
.
55 56 57 58 59 60 61 |
# File 'lib/bel/evidence_model/citation.rb', line 55 def self.create(fields = {}) citation = Citation.new (Citation.members & fields.keys).each { |member| citation.send(:"#{member}=", fields[member]) } citation end |
Instance Method Details
#valid? ⇒ Boolean
63 64 65 |
# File 'lib/bel/evidence_model/citation.rb', line 63 def valid? type != nil && id != nil && name != nil end |