Class: ModsDisplay::Form

Inherits:
Field
  • Object
show all
Defined in:
lib/mods_display/fields/form.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
# File 'lib/mods_display/fields/form.rb', line 5

def fields
  return [] unless form_elements.present?

  [
    ModsDisplay::Values.new(
      label: I18n.t('mods_display.form'),
      values: form_elements.map { |x| element_text(x) }.uniq { |x| x.downcase.gsub(/\s/, '').gsub(/[[:punct:]]/, '') }
    )
  ]
end