Sha256: 019d5ffa7ba0b129c8bd6ce35a1b8f00a75b32aa19c1857f95ba952092a7e7db

Contents?: true

Size: 602 Bytes

Versions: 19

Compression:

Stored size: 602 Bytes

Contents

require "yaml"

module RelatonGb
  class HashConverter < RelatonIsoBib::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?

        ccs_hash_to_bib(ret)
        ret
      end

      private

      def ccs_hash_to_bib(ret)
        ret[:ccs] = array(ret[:ccs]).map do |ccs|
          ccs[:code] ? Cnccs.fetch(ccs[:code]) : Cnccs.fetch(ccs)
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
relaton-gb-1.1.0 lib/relaton_gb/hash_converter.rb
relaton-gb-1.0.2 lib/relaton_gb/hash_converter.rb
relaton-gb-1.0.1 lib/relaton_gb/hash_converter.rb
relaton-gb-1.0.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.12.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.11.1 lib/relaton_gb/hash_converter.rb
relaton-gb-0.11.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.10.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.9.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.8.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.7.1 lib/relaton_gb/hash_converter.rb
relaton-gb-0.7.0 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.8 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.7 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.6 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.5 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.4 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.3 lib/relaton_gb/hash_converter.rb
relaton-gb-0.6.2 lib/relaton_gb/hash_converter.rb