Class: ModsDisplay::Publisher

Inherits:
Field
  • Object
show all
Defined in:
lib/mods_display/fields/publisher.rb

Instance Method Summary collapse

Methods inherited from Field

#initialize, #label, #render_in, #to_html

Constructor Details

This class inherits a constructor from ModsDisplay::Field

Instance Method Details

#fieldsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mods_display/fields/publisher.rb', line 5

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