Class: Terrier

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_dataObject (readonly)

Returns the value of attribute citation_data.



8
9
10
# File 'lib/terrier.rb', line 8

def citation_data
  @citation_data
end

#identifierObject (readonly)

Returns the value of attribute identifier.



8
9
10
# File 'lib/terrier.rb', line 8

def identifier
  @identifier
end

#zenodo_pdfObject (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

#dataObject



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