Class: RelatonOgc::OgcBibliography
- Inherits:
-
Object
- Object
- RelatonOgc::OgcBibliography
- Defined in:
- lib/relaton_ogc/ogc_bibliography.rb
Class Method Summary collapse
-
.get(code, year = nil, opts = {}) ⇒ String
Relaton XML serialisation of reference.
- .search(text, year = nil, _opts = {}) ⇒ RelatonOgc::HitCollection
Class Method Details
.get(code, year = nil, opts = {}) ⇒ String
Returns Relaton XML serialisation of reference.
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/relaton_ogc/ogc_bibliography.rb', line 21 def get(code, year = nil, opts = {}) result = bib_search_filter(code, year, opts) || (return nil) ret = bib_results_filter(result, year) if ret[:ret] warn "[relaton-ogc] (\"#{code}\") found #{ret[:ret].docidentifier.first.id}" ret[:ret] else fetch_ref_err(code, year, ret[:years]) end end |
.search(text, year = nil, _opts = {}) ⇒ RelatonOgc::HitCollection
6 7 8 9 10 |
# File 'lib/relaton_ogc/ogc_bibliography.rb', line 6 def search(text, year = nil, _opts = {}) HitCollection.new text, year rescue Faraday::ConnectionFailed raise RelatonBib::RequestError, HitCollection::ENDPOINT end |