Sha256: 4bc41c68b802261d3a61e892068bd5a3754395ca985c2f86b518904597460efe

Contents?: true

Size: 640 Bytes

Versions: 4

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

module ModsDisplay
  class Edition < Field
    def fields
      return_fields = @stanford_mods_elements.map do |origin_info_element|
        edition_value = Stanford::Mods::Imprint.new(origin_info_element).edition_vals_str
        next unless edition_value.present?

        # remove trailing spaces (thanks MARC, for catalog card formatting!)
        edition_value.gsub!(%r{ */$}, '')

        ModsDisplay::Values.new(
          label: I18n.t('mods_display.edition'),
          values: [edition_value],
          field: self
        )
      end.compact
      collapse_fields(return_fields)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mods_display-1.6.3 lib/mods_display/fields/edition.rb
mods_display-1.6.2 lib/mods_display/fields/edition.rb
mods_display-1.6.1 lib/mods_display/fields/edition.rb
mods_display-1.6.0 lib/mods_display/fields/edition.rb