Class: Relaton::Render::Ietf::Fields

Inherits:
Fields
  • Object
show all
Defined in:
lib/relaton/render/fields.rb

Instance Method Summary collapse

Instance Method Details

#compound_fields_format(hash) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/relaton/render/fields.rb', line 18

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

#nameformat(names, hash) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/relaton/render/fields.rb', line 5

def nameformat(names, hash)
  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, hash)
end