Class: ModsDisplay::Title

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

Direct Known Subclasses

SubTitle

Instance Method Summary collapse

Methods inherited from Field

#label, #render_in, #to_html

Constructor Details

#initialize(values, link: nil) ⇒ Title

Returns a new instance of Title.



5
6
7
8
# File 'lib/mods_display/fields/title.rb', line 5

def initialize(values, link: nil)
  @link = link
  super(values)
end

Instance Method Details

#fieldsObject



10
11
12
13
14
15
16
17
18
# File 'lib/mods_display/fields/title.rb', line 10

def fields
  return_values = sorted_title_info_elements.map do |title_info_element|
    ModsDisplay::Values.new(
      label: displayLabel(title_info_element) || title_label(title_info_element),
      values: [assemble_title(title_info_element)]
    )
  end
  collapse_fields(return_values)
end