Class: Terrier::DoiData

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/terrier/doi_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doi) ⇒ DoiData

Returns a new instance of DoiData.



5
6
7
# File 'lib/terrier/doi_data.rb', line 5

def initialize(doi)
  @doi = doi
end

Instance Attribute Details

#citation_infoObject (readonly)

Returns the value of attribute citation_info.



3
4
5
# File 'lib/terrier/doi_data.rb', line 3

def citation_info
  @citation_info
end

#doiObject (readonly)

Returns the value of attribute doi.



3
4
5
# File 'lib/terrier/doi_data.rb', line 3

def doi
  @doi
end

Instance Method Details

#dataObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/terrier/doi_data.rb', line 9

def data
  @citation_info = doi_citation_info
  {
    url: citation_info["URL"],
    journal: citation_info["container-title"],
    publisher: citation_info["publisher"],
    title: citation_info["title"],
    authors: authors,
    publication_year: publication_year,
    issn: citation_info["ISSN"],
    bibliography: bibliography
  }
end