Sha256: ecf9904eb960fc0634614d6e5b12bea53c5d01ba9ffdc06cfabb55dc09b4af62

Contents?: true

Size: 417 Bytes

Versions: 2

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true

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

    private

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mods_display-1.0.0 lib/mods_display/fields/resource_type.rb
mods_display-1.0.0.alpha5 lib/mods_display/fields/resource_type.rb