Class: Cocina::Models::Mapping::Normalizers::Mods::OriginInfoNormalizer
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::Normalizers::Mods::OriginInfoNormalizer
- Defined in:
- lib/cocina/models/mapping/normalizers/mods/origin_info_normalizer.rb
Overview
Normalizes a Fedora MODS document for originInfo elements. Must be called after authorityURI attribs are normalized
Constant Summary collapse
- DATE_FIELDS =
%w[dateIssued copyrightDate dateCreated dateCaptured dateValid dateOther dateModified].freeze
Class Method Summary collapse
-
.normalize(mods_ng_xml:) ⇒ Nokogiri::Document
Normalized MODS.
Instance Method Summary collapse
-
#initialize(mods_ng_xml:) ⇒ OriginInfoNormalizer
constructor
A new instance of OriginInfoNormalizer.
- #normalize ⇒ Object
Constructor Details
#initialize(mods_ng_xml:) ⇒ OriginInfoNormalizer
Returns a new instance of OriginInfoNormalizer.
19 20 21 22 |
# File 'lib/cocina/models/mapping/normalizers/mods/origin_info_normalizer.rb', line 19 def initialize(mods_ng_xml:) @ng_xml = mods_ng_xml.dup @ng_xml.encoding = 'UTF-8' end |
Class Method Details
.normalize(mods_ng_xml:) ⇒ Nokogiri::Document
Returns normalized MODS.
15 16 17 |
# File 'lib/cocina/models/mapping/normalizers/mods/origin_info_normalizer.rb', line 15 def self.normalize(mods_ng_xml:) new(mods_ng_xml: mods_ng_xml).normalize end |
Instance Method Details
#normalize ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cocina/models/mapping/normalizers/mods/origin_info_normalizer.rb', line 24 def normalize remove_empty_child_elements remove_empty_origin_info # must be after remove_empty_child_elements normalize_legacy_mods_event_type place_term_type_normalization # must be after place_term_type_normalization single_key_date remove_trailing_period_from_date_values ng_xml end |