Class: ModsDisplay::Collection
- Defined in:
- lib/mods_display/fields/collection.rb
Overview
Collection class to parse collection data out of Mods relatedItem fields
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
#collection_label(related_item_element) ⇒ Object
8 9 10 |
# File 'lib/mods_display/fields/collection.rb', line 8 def collection_label() displayLabel() || I18n.t('mods_display.collection') end |
#fields ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mods_display/fields/collection.rb', line 12 def fields return_fields = [] @stanford_mods_elements.each do || next unless () return_fields << ModsDisplay::Values.new( label: collection_label(), values: [element_text(.titleInfo)] ) end collapse_fields(return_fields) end |