Class: Cocina::Models::Mapping::FromMods::LanguageTerm

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

Overview

Maps language term attributes

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language_element:, notifier:) ⇒ LanguageTerm

Returns a new instance of LanguageTerm.



16
17
18
19
# File 'lib/cocina/models/mapping/from_mods/language_term.rb', line 16

def initialize(language_element:, notifier:)
  @language_element = language_element
  @notifier = notifier
end

Class Method Details

.build(language_element:, notifier:) ⇒ Hash

Returns a hash that can be mapped to a cocina model.

Parameters:

Returns:

  • (Hash)

    a hash that can be mapped to a cocina model



12
13
14
# File 'lib/cocina/models/mapping/from_mods/language_term.rb', line 12

def self.build(language_element:, notifier:)
  new(language_element: language_element, notifier: notifier).build
end

Instance Method Details

#buildObject



21
22
23
24
25
26
# File 'lib/cocina/models/mapping/from_mods/language_term.rb', line 21

def build
  attribs = lang_term_attributes
  attribs[:status] = status
  attribs[:script] = script_term_attributes
  attribs.compact
end