Module: Relaton::Omg::Bibliography

Extended by:
Bibliography
Included in:
Bibliography
Defined in:
lib/relaton/omg/bibliography.rb

Overview

OMG bibliography module

Instance Method Summary collapse

Instance Method Details

#get(code, _year = nil, _opts = {}) ⇒ Relaton::Omg::Item

Parameters:

  • code (String)

    the OMG standard reference

  • year (String)

    the year the standard was published (optional)

  • opts (Hash)

    options

Returns:



19
20
21
22
23
24
25
26
27
28
# File 'lib/relaton/omg/bibliography.rb', line 19

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.content}`", key: code
  else
    Util.info "Not found.", key: code
  end
  result
end

#search(text) ⇒ Relaton::Omg::Item

Parameters:

  • text (String)

    the OMG standard reference

Returns:



11
12
13
# File 'lib/relaton/omg/bibliography.rb', line 11

def search(text)
  Scraper.scrape_page text
end