Module: NEU::MODS::Projection::Languages

Includes:
Support
Included in:
NEU::MODS::Projection
Defined in:
lib/neu/mods/projection/languages.rb

Overview

Top-level language elements, a code-only term read through the ISO 639 registry. See docs/other-fields.md.

Constant Summary

Constants included from Support

Support::AUTHORITY_ATTRIBUTES

Instance Method Summary collapse

Instance Method Details

#languages ⇒ Object

{ term:, object_part:, script: } per language element. An entry, because



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/neu/mods/projection/languages.rb', line 17

def languages
  doc.xpath("/mods:mods/mods:language", NAMESPACE).filter_map do |lang|
    node = language_term_node(lang)
    term = language_term_of(node)
    next unless term

    # The authority comes off the <languageTerm>, never the <language>:
    # MODS puts @authority on the term.
    { term: term, object_part: attr_value(lang, "objectPart"), script: script_term(lang),
      **authority_of(node), **qualifiers_of(lang) }
  end
end