Class: PLOS::ArticleRef
- Inherits:
-
Object
- Object
- PLOS::ArticleRef
- Includes:
- XmlHelpers
- Defined in:
- lib/plos/article_ref.rb
Instance Attribute Summary collapse
-
#abstract ⇒ Object
Returns the value of attribute abstract.
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#client ⇒ Object
Returns the value of attribute client.
-
#eissn ⇒ Object
Returns the value of attribute eissn.
-
#id ⇒ Object
Returns the value of attribute id.
-
#journal ⇒ Object
Returns the value of attribute journal.
-
#node ⇒ Object
Returns the value of attribute node.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#score ⇒ Object
Returns the value of attribute score.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #article ⇒ Object
- #article_id ⇒ Object
- #article_part ⇒ Object
- #citation(format = "RIS") ⇒ Object
-
#initialize(client, node) ⇒ ArticleRef
constructor
A new instance of ArticleRef.
Methods included from XmlHelpers
#nodes_to_hash, #parse_node, #tag_value
Constructor Details
#initialize(client, node) ⇒ ArticleRef
Returns a new instance of ArticleRef.
22 23 24 25 26 27 28 29 |
# File 'lib/plos/article_ref.rb', line 22 def initialize(client, node) self.node = node self.client = client node.xpath('./*').each do |child| parse_node(child, self) end end |
Instance Attribute Details
#abstract ⇒ Object
Returns the value of attribute abstract.
15 16 17 |
# File 'lib/plos/article_ref.rb', line 15 def abstract @abstract end |
#authors ⇒ Object
Returns the value of attribute authors.
9 10 11 |
# File 'lib/plos/article_ref.rb', line 9 def @authors end |
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/plos/article_ref.rb', line 6 def client @client end |
#eissn ⇒ Object
Returns the value of attribute eissn.
10 11 12 |
# File 'lib/plos/article_ref.rb', line 10 def eissn @eissn end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/plos/article_ref.rb', line 11 def id @id end |
#journal ⇒ Object
Returns the value of attribute journal.
12 13 14 |
# File 'lib/plos/article_ref.rb', line 12 def journal @journal end |
#node ⇒ Object
Returns the value of attribute node.
5 6 7 |
# File 'lib/plos/article_ref.rb', line 5 def node @node end |
#published_at ⇒ Object
Returns the value of attribute published_at.
13 14 15 |
# File 'lib/plos/article_ref.rb', line 13 def published_at @published_at end |
#score ⇒ Object
Returns the value of attribute score.
7 8 9 |
# File 'lib/plos/article_ref.rb', line 7 def score @score end |
#title ⇒ Object
Returns the value of attribute title.
14 15 16 |
# File 'lib/plos/article_ref.rb', line 14 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/plos/article_ref.rb', line 8 def type @type end |
Instance Method Details
#article ⇒ Object
39 40 41 |
# File 'lib/plos/article_ref.rb', line 39 def article @article ||= PLOS::Article.get(article_id) end |
#article_id ⇒ Object
31 32 33 |
# File 'lib/plos/article_ref.rb', line 31 def article_id id.split("/")[0..1].join("/") if id end |
#article_part ⇒ Object
35 36 37 |
# File 'lib/plos/article_ref.rb', line 35 def article_part id.split("/")[2] if id end |