Class: CocinaDisplay::Events::Imprint

Inherits:
Event
  • Object
show all
Defined in:
lib/cocina_display/events/imprint.rb

Overview

Wrapper for Cocina events used to generate an imprint statement for display.

Instance Attribute Summary

Attributes inherited from Event

#cocina

Instance Method Summary collapse

Methods inherited from Event

#contributors, #date_types, #dates, #has_any_type?, #has_type?, #initialize, #locations, #type

Constructor Details

This class inherits a constructor from CocinaDisplay::Events::Event

Instance Method Details

#date_encoding?Boolean

Were any of the dates encoded? Used to detect which event(s) most likely represent the actual imprint(s).

Returns:

  • (Boolean)


27
28
29
# File 'lib/cocina_display/events/imprint.rb', line 27

def date_encoding?
  dates.any?(&:encoding?)
end

#display_strString

The entire imprint statement formatted as a string for display.

Returns:

  • (String)


19
20
21
22
23
# File 'lib/cocina_display/events/imprint.rb', line 19

def display_str
  place_pub = Utils.compact_and_join([place_str, publisher_str], delimiter: " : ")
  edition_place_pub = Utils.compact_and_join([edition_str, place_pub], delimiter: " - ")
  Utils.compact_and_join([edition_place_pub, date_str], delimiter: ", ")
end