Class: RelatonIetf::HashConverter

Inherits:
RelatonBib::HashConverter
  • Object
show all
Defined in:
lib/relaton_ietf/hash_converter.rb

Class Method Summary collapse

Class Method Details

.bib_item(item) ⇒ Object

Ovverides superclass’s method

Parameters:

  • item (Hash)


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

def bib_item(item)
  IetfBibliographicItem.new(**item)
end

.editorialgroup_hash_to_bib(ret) ⇒ Object

Parameters:

  • ret (Hash)


22
23
24
25
26
27
28
29
# File 'lib/relaton_ietf/hash_converter.rb', line 22

def editorialgroup_hash_to_bib(ret)
  return unless ret[:editorialgroup]

  technical_committee = RelatonBib.array(ret[:editorialgroup]).map do |wg|
    Committee.new RelatonBib::WorkGroup.new(**wg)
  end
  ret[:editorialgroup] = RelatonBib::EditorialGroup.new technical_committee
end

.hash_to_bib(hash) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/relaton_ietf/hash_converter.rb', line 4

def hash_to_bib(hash)
  ret = super
  return unless ret

  stream_hash_to_bib ret
  ret
end

.stream_hash_to_bib(ret) ⇒ Object



31
32
33
# File 'lib/relaton_ietf/hash_converter.rb', line 31

def stream_hash_to_bib(ret)
  ret[:stream] = ret[:ext][:stream] if ret[:ext]&.key? :stream
end