Sha256: 40142df81d435cb22152e5bd6aa7bbc395df3dfe016e5baf78f07d6f4190d688

Contents?: true

Size: 575 Bytes

Versions: 4

Compression:

Stored size: 575 Bytes

Contents

# frozen_string_literal: true

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

        publisher_value.gsub!(/ *,$/, '')

        ModsDisplay::Values.new(
          label: I18n.t('mods_display.publisher'),
          values: [publisher_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/publisher.rb
mods_display-1.6.2 lib/mods_display/fields/publisher.rb
mods_display-1.6.1 lib/mods_display/fields/publisher.rb
mods_display-1.6.0 lib/mods_display/fields/publisher.rb