Class: Cocina::Models::Mapping::FromMods::Note

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/from_mods/note.rb

Overview

Maps notes

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_element:) ⇒ Note

Returns a new instance of Note.



18
19
20
# File 'lib/cocina/models/mapping/from_mods/note.rb', line 18

def initialize(resource_element:)
  @resource_element = resource_element
end

Class Method Details

.build(resource_element:, description_builder: nil, purl: nil) ⇒ Hash

def self.build(resource_element:, description_builder: nil, purl: nil)

Parameters:

  • resource_element (Nokogiri::XML::Element)

    mods or relatedItem element

  • description_builder (Cocina::Models::Mapping::FromMods::DescriptionBuilder) (defaults to: nil)

    (not used, but passed in by DescriptionBuilder)

  • purl (String) (defaults to: nil)

    (not used, but passed in by DescriptionBuilder)

Returns:

  • (Hash)

    a hash that can be mapped to a cocina model



14
15
16
# File 'lib/cocina/models/mapping/from_mods/note.rb', line 14

def self.build(resource_element:, description_builder: nil, purl: nil)
  new(resource_element: resource_element).build
end

Instance Method Details

#buildObject



22
23
24
# File 'lib/cocina/models/mapping/from_mods/note.rb', line 22

def build
  abstracts + notes + table_of_contents + target_audience + parts
end