Sha256: ef0147d7aa9216a70823027e37da8a89ed7f9b6198133685256f4ffabddcce9e

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

module RelatonNist
  class HashConverter < RelatonBib::HashConverter
    class << self
      # @override RelatonBib::HashConverter.hash_to_bib
      # @param args [Hash]
      # @param nested [TrueClass, FalseClass]
      # @return [Hash]
      def hash_to_bib(args, nested = false)
        ret = super
        return if ret.nil?

        commentperiod_hash_to_bib(ret)
        ret
      end

      private

      # @param item_hash [Hash]
      # @return [RelatonNist::NistBibliographicItem]
      def bib_item(item_hash)
        NistBibliographicItem.new item_hash
      end

      def commentperiod_hash_to_bib(ret)
        return unless ret[:commentperiod]

        ret[:commentperiod] = CommentPeriod.new ret[:commentperiod]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
relaton-nist-1.2.0 lib/relaton_nist/hash_converter.rb