Sha256: beb717734bbb2fd08bae2969e740ef28179d74d83a11b17d25229be31f01ac7d

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

# frozen_string_literal: true

module ModsDisplay
  class ResourceType < Field
    def fields
      return_fields = @stanford_mods_elements.map do |type_of_resource_element|
        ModsDisplay::Values.new(
          label: displayLabel(type_of_resource_element) || label,
          values: [element_text(type_of_resource_element)]
        )
      end
      collapse_fields(return_fields)
    end

    private

    def displayLabel(type_of_resource_element)
      super || I18n.t('mods_display.type_of_resource')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mods_display-1.6.3 lib/mods_display/fields/resource_type.rb