Class: Cocina::Models::Mapping::FromMods::PartBuilder
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::FromMods::PartBuilder
- Defined in:
- lib/cocina/models/mapping/from_mods/part_builder.rb
Overview
Maps parts
Class Method Summary collapse
-
.build(part_element:) ⇒ Hash
A hash that can be mapped to a cocina model.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(part_element:) ⇒ PartBuilder
constructor
A new instance of PartBuilder.
Constructor Details
#initialize(part_element:) ⇒ PartBuilder
Returns a new instance of PartBuilder.
15 16 17 |
# File 'lib/cocina/models/mapping/from_mods/part_builder.rb', line 15 def initialize(part_element:) @part_element = part_element end |
Class Method Details
.build(part_element:) ⇒ Hash
Returns a hash that can be mapped to a cocina model.
11 12 13 |
# File 'lib/cocina/models/mapping/from_mods/part_builder.rb', line 11 def self.build(part_element:) new(part_element: part_element).build end |
Instance Method Details
#build ⇒ Object
19 20 21 |
# File 'lib/cocina/models/mapping/from_mods/part_builder.rb', line 19 def build structured_value? ? structured_value : grouped_value end |