Module: RelatonIetf::HashConverter

Extended by:
HashConverter
Includes:
RelatonBib::HashConverter
Included in:
HashConverter
Defined in:
lib/relaton_ietf/hash_converter.rb

Instance Method Summary collapse

Instance Method Details

#bib_item(item) ⇒ Object

Ovverides superclass’s method

Parameters:

  • item (Hash)


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

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

#create_doctype(**args) ⇒ Object



36
37
38
# File 'lib/relaton_ietf/hash_converter.rb', line 36

def create_doctype(**args)
  DocumentType.new(**args)
end

#editorialgroup_hash_to_bib(ret) ⇒ Object

Parameters:

  • ret (Hash)


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

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



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

def hash_to_bib(hash)
  ret = super
  return unless ret

  stream_hash_to_bib ret
  ret
end

#stream_hash_to_bib(ret) ⇒ Object



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

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