Module: Relaton3gpp::HashConverter

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

Instance Method Summary collapse

Instance Method Details

#bib_item(item_hash) ⇒ Relaton3gpp::BibliographicItem

Parameters:

  • item_hash (Hash)

Returns:



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

def bib_item(item_hash)
  BibliographicItem.new(**item_hash)
end

#create_doctype(**type) ⇒ Object



22
23
24
# File 'lib/relaton_3gpp/hash_converter.rb', line 22

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

#hash_to_bib(args) ⇒ Object



6
7
8
9
10
# File 'lib/relaton_3gpp/hash_converter.rb', line 6

def hash_to_bib(args)
  hash = super
  release_hash_to_bib(hash)
  hash
end

#release_hash_to_bib(hash) ⇒ Object



12
13
14
# File 'lib/relaton_3gpp/hash_converter.rb', line 12

def release_hash_to_bib(hash)
  hash[:release] &&= Release.new(**hash[:release])
end