class RelatonNist::HashConverter
Public Class Methods
hash_to_bib(args, nested = false)
click to toggle source
@override RelatonBib::HashConverter.hash_to_bib @param args [Hash] @param nested [TrueClass, FalseClass] @return [Hash]
Calls superclass method
# File lib/relaton_nist/hash_converter.rb, line 8 def hash_to_bib(args, nested = false) ret = super return if ret.nil? commentperiod_hash_to_bib(ret) ret end
Private Class Methods
bib_item(item_hash)
click to toggle source
@param item_hash [Hash] @return [RelatonNist::NistBibliographicItem]
# File lib/relaton_nist/hash_converter.rb, line 20 def bib_item(item_hash) NistBibliographicItem.new **item_hash end
commentperiod_hash_to_bib(ret)
click to toggle source
# File lib/relaton_nist/hash_converter.rb, line 24 def commentperiod_hash_to_bib(ret) return unless ret[:commentperiod] ret[:commentperiod] = CommentPeriod.new **ret[:commentperiod] end
relations_hash_to_bib(ret)
click to toggle source
@param ret [Hash]
Calls superclass method
# File lib/relaton_nist/hash_converter.rb, line 31 def relations_hash_to_bib(ret) super return unless ret[:relation] ret[:relation] = ret[:relation].map { |r| DocumentRelation.new **r } # ret[:relation] = array(ret[:relation]) # ret[:relation]&.each do |r| # if r[:description] # r[:description] = FormattedString.new r[:description] # end # relation_bibitem_hash_to_bib(r) # relation_locality_hash_to_bib(r) # relation_source_locality_hash_to_bib(r) # end end