Module: Pubid::Rendering::Supplement

Included in:
Base
Defined in:
lib/pubid/rendering/supplement.rb

Instance Method Summary collapse

Instance Method Details

#render_supplements(base_identifier, supplements, **options) ⇒ String

Render supplement identifiers (amendment, corrigendum, addendum, etc.)

Parameters:

  • base_identifier (Identifier)

    base identifier

  • supplements (Array<Hash>)

    list of supplements

  • options (Hash)

    rendering options

Returns:

  • (String)

    formatted supplement string



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pubid/rendering/supplement.rb', line 11

def render_supplements(base_identifier, supplements, **options)
  return base_identifier.to_s(**options) unless supplements&.any?

  result = base_identifier.to_s(**options)

  supplements.each do |supp|
    result += render_single_supplement(supp, **options)
  end

  result
end