Class: Cocina::Models::Mapping::FromMods::ValueURI

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/from_mods/value_uri.rb

Overview

Sniffs value URIs

Constant Summary collapse

SUPPORTED_PREFIXES =
[
  'http'
].freeze

Class Method Summary collapse

Class Method Details

.sniff(uri, notifier) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/cocina/models/mapping/from_mods/value_uri.rb', line 13

def self.sniff(uri, notifier)
  if uri.present? && !uri.starts_with?(*SUPPORTED_PREFIXES)
    notifier.warn('Value URI has unexpected value',
                  { uri: uri })
  end

  uri.presence
end