Class: ModsDisplay::Description

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

Instance Method Summary collapse

Methods inherited from Field

#initialize, #label, #to_html

Constructor Details

This class inherits a constructor from ModsDisplay::Field

Instance Method Details

#description_label(element) ⇒ Object



10
11
12
# File 'lib/mods_display/fields/description.rb', line 10

def description_label(element)
  label || displayLabel(element) || labels[element.name.to_sym] || I18n.t('mods_display.physical_description')
end

#fieldsObject



3
4
5
6
7
8
# File 'lib/mods_display/fields/description.rb', line 3

def fields
  return_fields = description_fields.map do |value|
    ModsDisplay::Values.new(label: description_label(value), values: [value.text])
  end
  collapse_fields(return_fields)
end