Class: Pubid::Renderers::HumanReadable

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/renderers/human_readable.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, render

Constructor Details

This class inherits a constructor from Pubid::Renderers::Base

Instance Method Details

#render(context:, with_edition: false) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/pubid/renderers/human_readable.rb', line 6

def render(context:, with_edition: false)
  parts = []
  parts << render_publisher_and_stage(context)
  parts << render_number_portion(context)
  parts << render_edition_portion(context) if with_edition
  result = parts.compact.join(" ")
  result << render_language_portion(context, with_edition: with_edition)
  result << " (all parts)" if @id.all_parts
  result
end