Module: RelatonOmg::OmgBibliography

Defined in:
lib/relaton_omg/omg_bibliography.rb

Overview

OMG bibliography module

Class Method Summary collapse

Class Method Details

.get(code, _year = nil, _opts = {}) ⇒ RelatonOmg::OmgBibliographicItem

Parameters:

  • code (String)

    the OMG standard reference

  • year (String)

    the year the standard was published (optional)

  • opts (Hash)

    options

Returns:



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

def get(code, _year = nil, _opts = {})
  Util.info "Fetching from www.omg.org ...", 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(text) ⇒ RelatonOmg::OmgBibliographicItem

Parameters:

  • code (String)

    the OMG standard reference

Returns:



9
10
11
# File 'lib/relaton_omg/omg_bibliography.rb', line 9

def search(text)
  Scraper.scrape_page text
end