Sha256: 815cc210e6d20b4c7409b807762f1794ee2c852b8295c4899ec278a39d8f9e7d

Contents?: true

Size: 386 Bytes

Versions: 5

Compression:

Stored size: 386 Bytes

Contents

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

5 entries across 5 versions & 1 rubygems

Version Path
mods_display-1.0.0.alpha4 lib/mods_display/fields/resource_type.rb
mods_display-1.0.0.alpha3 lib/mods_display/fields/resource_type.rb
mods_display-1.0.0.alpha2 lib/mods_display/fields/resource_type.rb
mods_display-1.0.0.alpha1 lib/mods_display/fields/resource_type.rb
mods_display-0.10.1 lib/mods_display/fields/resource_type.rb