Class: Isobib::IsoBibliography

Inherits:
Object
  • Object
show all
Defined in:
lib/isobib/iso_bibliography.rb

Overview

Class methods for search ISO standards.

Class Method Summary collapse

Class Method Details

.get(code, year, opts) ⇒ String

Returns Relaton XML serialisation of reference.

Parameters:

  • code (String)

    the ISO standard Code to look up (e..g “ISO 9000”)

  • year (String)

    the year the standard was published (optional)

  • opts (Hash)

    options; restricted to :all_parts if all-parts reference is required

Returns:

  • (String)

    Relaton XML serialisation of reference



27
28
29
30
31
32
33
34
35
# File 'lib/isobib/iso_bibliography.rb', line 27

def get(code, year, opts)
  return iev.to_xml if code.casecmp("IEV") == 0
  code += "-1" if opts[:all_parts]
  ret = isobib_get1(code, year, opts)
  return nil if ret.nil?
  ret.to_most_recent_reference if !year
  ret.to_all_parts if opts[:all_parts]
  ret.to_xml
end

.search(text) ⇒ Isobib::HitPages

Parameters:

  • text (String)

Returns:



13
14
15
# File 'lib/isobib/iso_bibliography.rb', line 13

def search(text)
  HitPages.new text
end

.search_and_fetch(text) ⇒ Array<IsoBibliographicItem>

Parameters:

  • text (String)

Returns:

  • (Array<IsoBibliographicItem>)


19
20
21
# File 'lib/isobib/iso_bibliography.rb', line 19

def search_and_fetch(text)
  Scrapper.get(text)
end