Class: Terrier
- Inherits:
-
Object
- Object
- Terrier
- Defined in:
- lib/terrier.rb,
lib/terrier/version.rb
Defined Under Namespace
Classes: DoiData, HtmlData, UrlError
Constant Summary collapse
- VERSION =
"1.0.2"
Instance Attribute Summary collapse
-
#citation_data ⇒ Object
readonly
Returns the value of attribute citation_data.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#zenodo_pdf ⇒ Object
readonly
if the article is pulled by dio and can be found on zenodo we can pull the pdf from the html link.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(identifier) ⇒ Terrier
constructor
A new instance of Terrier.
Constructor Details
#initialize(identifier) ⇒ Terrier
Returns a new instance of Terrier.
10 11 12 13 14 |
# File 'lib/terrier.rb', line 10 def initialize(identifier) @identifier = identifier @citation_data = {} data end |
Instance Attribute Details
#citation_data ⇒ Object (readonly)
Returns the value of attribute citation_data.
8 9 10 |
# File 'lib/terrier.rb', line 8 def citation_data @citation_data end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
8 9 10 |
# File 'lib/terrier.rb', line 8 def identifier @identifier end |
#zenodo_pdf ⇒ Object (readonly)
if the article is pulled by dio and can be found on zenodo we can pull the pdf from the html link. this is a bit unclean
27 28 29 |
# File 'lib/terrier.rb', line 27 def zenodo_pdf @zenodo_pdf end |
Instance Method Details
#data ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/terrier.rb', line 16 def data if uri?(@identifier) html_data else doi_data(identifier) end end |