Class: Cocina::Models::Mapping::FromMods::LanguageTerm
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::FromMods::LanguageTerm
- Defined in:
- lib/cocina/models/mapping/from_mods/language_term.rb
Overview
Maps language term attributes
Class Method Summary collapse
-
.build(language_element:, notifier:) ⇒ Hash
A hash that can be mapped to a cocina model.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(language_element:, notifier:) ⇒ LanguageTerm
constructor
A new instance of LanguageTerm.
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.
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
#build ⇒ Object
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 |