Sha256: 0dfdb79049f69683b060c25d88e02253989409990c71a43cafd75ab6799340a1

Contents?: true

Size: 443 Bytes

Versions: 9

Compression:

Stored size: 443 Bytes

Contents

module Krikri::Enrichments
  ##
  # Removes non-DCMI Type values from a field
  class DcmiEnforcer
    include Audumbla::FieldEnrichment

    ##
    # @param value [Object] the value to enrich
    #
    # @return [DPLA::MAP::Controlled::DCMIType, nil] the original value or `nil`
    def enrich_value(value)
      return nil unless value.is_a? DPLA::MAP::Controlled::DCMIType
      return nil unless value.valid?
      value
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
krikri-0.8.1 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.8.0 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.6 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.5 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.4 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.3 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.2 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.1 lib/krikri/enrichments/dcmi_enforcer.rb
krikri-0.7.0 lib/krikri/enrichments/dcmi_enforcer.rb