Class: Cocina::Models::Mapping::FromMods::RelatedResource
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::FromMods::RelatedResource
- Defined in:
- lib/cocina/models/mapping/from_mods/related_resource.rb
Overview
Maps MODS relatedItem to cocina relatedResource
Constant Summary collapse
- TYPES =
Cocina::Models::Mapping::ToMods::RelatedResource::TYPES.invert.freeze
- DETAIL_TYPES =
Cocina::Models::Mapping::ToMods::RelatedResource::DETAIL_TYPES.invert.freeze
Class Method Summary collapse
-
.build(resource_element:, description_builder:, purl:) ⇒ Hash
A hash that can be mapped to a cocina model.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(resource_element:, description_builder:, purl:) ⇒ RelatedResource
constructor
A new instance of RelatedResource.
Constructor Details
#initialize(resource_element:, description_builder:, purl:) ⇒ RelatedResource
Returns a new instance of RelatedResource.
20 21 22 23 24 25 |
# File 'lib/cocina/models/mapping/from_mods/related_resource.rb', line 20 def initialize(resource_element:, description_builder:, purl:) @resource_element = resource_element @description_builder = description_builder @notifier = description_builder.notifier @purl = purl end |
Class Method Details
.build(resource_element:, description_builder:, purl:) ⇒ Hash
Returns a hash that can be mapped to a cocina model.
16 17 18 |
# File 'lib/cocina/models/mapping/from_mods/related_resource.rb', line 16 def self.build(resource_element:, description_builder:, purl:) new(resource_element: resource_element, description_builder: description_builder, purl: purl).build end |
Instance Method Details
#build ⇒ Object
27 28 29 |
# File 'lib/cocina/models/mapping/from_mods/related_resource.rb', line 27 def build + end |