Class: Metanorma::IsoDocument::Metadata::TitleCollection

Inherits:
Lutaml::Model::Collection
  • Object
show all
Defined in:
lib/metanorma/iso_document/metadata/title_collection.rb

Overview

Collection for title elements with consolidation mapping. Groups titles by language and routes by type to typed attributes.

Usage:

bibdata.titles.items        # => All raw AbstractTitle instances
bibdata.titles.per_language # => Array of IsoLocalizedTitle grouped by language

Instance Method Summary collapse

Instance Method Details

#for_language(language = "en") ⇒ Object

Find the localized title for a given language



40
41
42
# File 'lib/metanorma/iso_document/metadata/title_collection.rb', line 40

def for_language(language = "en")
  per_language.find { |g| g.language == language }
end