Class: RelatonIetf::Processor

Inherits:
Relaton::Processor
  • Object
show all
Defined in:
lib/relaton_ietf/processor.rb

Instance Method Summary collapse

Constructor Details

#initializeProcessor

Returns a new instance of Processor.



6
7
8
9
10
11
# File 'lib/relaton_ietf/processor.rb', line 6

def initialize
  @short = :relaton_ietf
  @prefix = "IETF"
  @defaultprefix = /^RFC /
  @idtype = "IETF"
end

Instance Method Details

#from_xml(xml) ⇒ RelatonIetf::IetfBibliographicItem

Parameters:

  • xml (String)

Returns:



23
24
25
# File 'lib/relaton_ietf/processor.rb', line 23

def from_xml(xml)
  ::RelatonIetf::XMLParser.from_xml xml
end

#get(code, date, opts) ⇒ RelatonIetf::IetfBibliographicItem

Parameters:

  • code (String)
  • date (String, NilClass)

    year

  • opts (Hash)

Returns:



17
18
19
# File 'lib/relaton_ietf/processor.rb', line 17

def get(code, date, opts)
  ::RelatonIetf::IetfBibliography.get(code, date, opts)
end

#grammar_hashString

Returns hash of XML grammar

Returns:

  • (String)


35
36
37
# File 'lib/relaton_ietf/processor.rb', line 35

def grammar_hash
  @grammar_hash ||= ::RelatonIetf.grammar_hash
end

#hash_to_bib(hash) ⇒ RelatonIetf::IetfBibliographicItem

Parameters:

  • hash (Hash)

Returns:



29
30
31
# File 'lib/relaton_ietf/processor.rb', line 29

def hash_to_bib(hash)
  ::RelatonIetf::IetfBibliographicItem.from_hash hash
end