Sha256: 390e3ec2cc70653c6b8d0082b311cff2e0feac9299a9ce9c7d2713359e3ee5ec

Contents?: true

Size: 882 Bytes

Versions: 7

Compression:

Stored size: 882 Bytes

Contents

module RelatonUn
  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?

        ret[:submissionlanguage] = array ret[:submissionlanguage]
        session_hash_to_bib ret
        ret
      end

      private

      # @param ret [Hash]
      def session_hash_to_bib(ret)
        ret[:session] = Session.new(**ret[:session]) if ret[:session]
      end

      # @param ret [Hash]
      def editorialgroup_hash_to_bib(ret)
        eg = ret[:editorialgroup]
        return unless eg

        committee = eg.map { |e| e[:committee] }
        ret[:editorialgroup] = EditorialGroup.new array(committee)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
relaton-un-1.11.0 lib/relaton_un/hash_converter.rb
relaton-un-1.10.1 lib/relaton_un/hash_converter.rb
relaton-un-1.10.0 lib/relaton_un/hash_converter.rb
relaton-un-1.9.0 lib/relaton_un/hash_converter.rb
relaton-un-1.8.0 lib/relaton_un/hash_converter.rb
relaton-un-1.7.2 lib/relaton_un/hash_converter.rb
relaton-un-1.7.1 lib/relaton_un/hash_converter.rb