Class: Cocina::Models::Mapping::ToMods::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/to_mods/language.rb

Overview

Maps languages from cocina to MODS XML

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml:, languages:) ⇒ Language

Returns a new instance of Language.



15
16
17
18
# File 'lib/cocina/models/mapping/to_mods/language.rb', line 15

def initialize(xml:, languages:)
  @xml = xml
  @languages = languages
end

Class Method Details

.write(xml:, languages:) ⇒ Object



11
12
13
# File 'lib/cocina/models/mapping/to_mods/language.rb', line 11

def self.write(xml:, languages:)
  new(xml: xml, languages: languages).write
end

Instance Method Details

#writeObject



20
21
22
23
24
# File 'lib/cocina/models/mapping/to_mods/language.rb', line 20

def write
  Array(languages).each do |language|
    write_basic(language)
  end
end