Class: Cocina::Models::Mapping::FromMods::AdminMetadata
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::FromMods::AdminMetadata
- Defined in:
- lib/cocina/models/mapping/from_mods/admin_metadata.rb
Overview
Maps MODS recordInfo to cocina
Class Method Summary collapse
-
.build(resource_element:, description_builder:, purl: nil) ⇒ Hash
A hash that can be mapped to a cocina model.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(resource_element:, description_builder:) ⇒ AdminMetadata
constructor
A new instance of AdminMetadata.
Constructor Details
#initialize(resource_element:, description_builder:) ⇒ AdminMetadata
Returns a new instance of AdminMetadata.
17 18 19 20 21 |
# File 'lib/cocina/models/mapping/from_mods/admin_metadata.rb', line 17 def initialize(resource_element:, description_builder:) @resource_element = resource_element @description_builder = description_builder @notifier = description_builder.notifier end |
Class Method Details
.build(resource_element:, description_builder:, purl: nil) ⇒ Hash
Returns a hash that can be mapped to a cocina model.
13 14 15 |
# File 'lib/cocina/models/mapping/from_mods/admin_metadata.rb', line 13 def self.build(resource_element:, description_builder:, purl: nil) new(resource_element: resource_element, description_builder: description_builder).build end |
Instance Method Details
#build ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cocina/models/mapping/from_mods/admin_metadata.rb', line 23 def build return nil if record_info.nil? {}.tap do || [:language] = build_language [:contributor] = build_contributor [:metadataStandard] = build_standard [:note] = build_note [:identifier] = build_identifier [:event] = build_events end.compact end |