Class: CocinaDisplay::Events::Imprint
- 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
Instance Method Summary collapse
-
#date_encoding? ⇒ Boolean
Were any of the dates encoded? Used to detect which event(s) most likely represent the actual imprint(s).
-
#to_s ⇒ String
The entire imprint statement formatted as a string for display.
Methods inherited from Event
#contributors, #date_types, #dates, #has_any_type?, #has_type?, #initialize, #locations, #notes, #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).
17 18 19 |
# File 'lib/cocina_display/events/imprint.rb', line 17 def date_encoding? dates.any?(&:encoding?) end |
#to_s ⇒ String
The entire imprint statement formatted as a string for display.
9 10 11 12 13 |
# File 'lib/cocina_display/events/imprint.rb', line 9 def to_s 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 |