Module: RelatonCie::CieBibliography

Defined in:
lib/relaton_cie/cie_bibliography.rb

Overview

IETF bibliography module

Class Method Summary collapse

Class Method Details

.get(code, _year = nil, _opts = {}) ⇒ RelatonCie::BibliographicItem

Returns Relaton of reference.

Parameters:

  • code (String)

    the ECMA standard Code to look up (e..g “ECMA-6”)

  • year (String)

    not used

  • opts (Hash)

    not used

Returns:



17
18
19
20
21
22
23
24
25
26
# File 'lib/relaton_cie/cie_bibliography.rb', line 17

def get(code, _year = nil, _opts = {})
  Util.info "Fetching from Relaton repository ...", key: code
  result = search code
  if result
    Util.info "Found: `#{result.docidentifier.first.id}`", key: code
  else
    Util.info "Not found.", key: code
  end
  result
end

.search(code) ⇒ RelatonBib::BibliographicEcma

Parameters:

  • code (String)

    the ECMA standard Code to look up (e..g “ECMA-6”)

Returns:

  • (RelatonBib::BibliographicEcma)


9
10
11
# File 'lib/relaton_cie/cie_bibliography.rb', line 9

def search(code)
  Scrapper.scrape_page code
end