Class: Cocina::Models::Mapping::Normalizers::Mods::GeoExtensionNormalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/normalizers/mods/geo_extension_normalizer.rb

Overview

Normalizes a Fedora MODS document for geo extension elements.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mods_ng_xml:, druid:) ⇒ GeoExtensionNormalizer

Returns a new instance of GeoExtensionNormalizer.



17
18
19
20
21
# File 'lib/cocina/models/mapping/normalizers/mods/geo_extension_normalizer.rb', line 17

def initialize(mods_ng_xml:, druid:)
  @ng_xml = mods_ng_xml.dup
  @ng_xml.encoding = 'UTF-8'
  @druid = druid
end

Class Method Details

.normalize(mods_ng_xml:, druid:) ⇒ Nokogiri::Document

Returns normalized MODS.

Parameters:

  • mods_ng_xml (Nokogiri::Document)

    MODS to be normalized

  • druid (String)

Returns:

  • (Nokogiri::Document)

    normalized MODS



13
14
15
# File 'lib/cocina/models/mapping/normalizers/mods/geo_extension_normalizer.rb', line 13

def self.normalize(mods_ng_xml:, druid:)
  new(mods_ng_xml: mods_ng_xml, druid: druid).normalize
end

Instance Method Details

#normalizeObject



23
24
25
26
27
28
29
# File 'lib/cocina/models/mapping/normalizers/mods/geo_extension_normalizer.rb', line 23

def normalize
  normalize_geo_purl
  normalize_dc_image
  normalize_gml_id
  normalize_empty_resource
  ng_xml
end