Sha256: 45121cc728e338b2da40bdb8ed564d4ade98d1ed5f9c34cc30e872edf18639d1

Contents?: true

Size: 863 Bytes

Versions: 10

Compression:

Stored size: 863 Bytes

Contents

module Relaton
  module Render
    module Ietf
      class Fields < ::Relaton::Render::Fields
        def nameformat(names)
          names.nil? and return names
          parts = %i(surname initials given middle nonpersonal
                     nonpersonalabbrev completename)
          names_out = names.each_with_object({}) do |n, m|
            parts.each do |i|
              m[i] ||= []
              m[i] << n[i]
            end
          end
          @r.nametemplate.render(names_out)
        end

        # do not format months
        def dateformat(date, _hash, _type)
          date.nil? and return nil
          date_range(date)
        end

        def compound_fields_format(hash)
          ret = super
          ret[:included]&.each do |h|
            compound_fields_format(h)
          end
          ret
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
metanorma-ietf-3.4.3 lib/relaton/render/fields.rb
metanorma-ietf-3.4.2 lib/relaton/render/fields.rb
metanorma-ietf-3.4.0 lib/relaton/render/fields.rb
metanorma-ietf-3.3.10 lib/relaton/render/fields.rb
metanorma-ietf-3.3.9 lib/relaton/render/fields.rb
metanorma-ietf-3.3.8 lib/relaton/render/fields.rb
metanorma-ietf-3.3.7 lib/relaton/render/fields.rb
metanorma-ietf-3.3.6 lib/relaton/render/fields.rb
metanorma-ietf-3.3.5 lib/relaton/render/fields.rb
metanorma-ietf-3.3.4 lib/relaton/render/fields.rb