Sha256: 0adda4467714381e243c4080eef20332c78f046f3f30a266eef30c5980b836cb

Contents?: true

Size: 874 Bytes

Versions: 7

Compression:

Stored size: 874 Bytes

Contents

module RelatonIho
  class HashConverter < RelatonBib::HashConverter
    class << self
      # @override RelatonIsoBib::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 ret [Hash]
      def commentperiod_hash_to_bib(ret)
        ret[:commentperiod] &&= CommentPeriond.new(ret[:commentperiod])
      end

      # @param ret [Hash]
      def editorialgroup_hash_to_bib(ret)
        eg = ret[:editorialgroup]
        return unless eg.is_a?(Hash) || eg&.any?

        collection = array(eg).map { |g| EditorialGroup.new g }
        ret[:editorialgroup] = EditorialGroupCollection.new collection
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
relaton-iho-1.3.0 lib/relaton_iho/hash_converter.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/relaton-iho-1.2.3/lib/relaton_iho/hash_converter.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/relaton-iho-1.2.3/lib/relaton_iho/hash_converter.rb
relaton-iho-1.2.3 lib/relaton_iho/hash_converter.rb
relaton-iho-1.2.2 lib/relaton_iho/hash_converter.rb
relaton-iho-1.2.1 lib/relaton_iho/hash_converter.rb
relaton-iho-1.2.0 lib/relaton_iho/hash_converter.rb