Class: ModsDisplay::Place

Inherits:
Field
  • Object
show all
Includes:
CountryCodes
Defined in:
lib/mods_display/fields/place.rb

Instance Method Summary collapse

Methods included from CountryCodes

#country_codes

Methods inherited from Field

#initialize, #label, #render_in, #to_html

Constructor Details

This class inherits a constructor from ModsDisplay::Field

Instance Method Details

#fieldsObject



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

def fields
  return_fields = @stanford_mods_elements.map do |origin_info_element|
    place_value = place_element(origin_info_element)
    next unless place_value.present?

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