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, #render_in, #to_html

Constructor Details

This class inherits a constructor from ModsDisplay::Field

Instance Method Details

#description_label(element) ⇒ Object



15
16
17
# File 'lib/mods_display/fields/description.rb', line 15

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

#fieldsObject



5
6
7
8
9
10
11
12
13
# File 'lib/mods_display/fields/description.rb', line 5

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