Sha256: 39e8491e12d0c33f4af7b94e6cd85599ca542585302375121167a1b702d82936

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true

require "lutaml/model"

module LocMods
  class SubjectTitleInfo < Lutaml::Model::Serializable
    attribute :id, :string
    attribute :authority, :string
    attribute :authority_uri, :string
    attribute :value_uri, :string
    attribute :lang, :string
    attribute :script, :string
    attribute :transliteration, :string
    attribute :display_label, :string
    attribute :type, :string
    attribute :title, :string, collection: true
    attribute :sub_title, :string, collection: true
    attribute :part_number, :string, collection: true
    attribute :part_name, :string, collection: true
    attribute :non_sort, :string, collection: true

    xml do
      root "subjectTitleInfo"
      namespace "http://www.loc.gov/mods/v3", nil

      map_attribute "ID", to: :id
      map_attribute "authority", to: :authority
      map_attribute "authorityURI", to: :authority_uri
      map_attribute "valueURI", to: :value_uri
      map_attribute "lang", to: :lang
      map_attribute "script", to: :script
      map_attribute "transliteration", to: :transliteration
      map_attribute "displayLabel", to: :display_label
      map_attribute "type", to: :type
      map_element "title", to: :title
      map_element "subTitle", to: :sub_title
      map_element "partNumber", to: :part_number
      map_element "partName", to: :part_name
      map_element "nonSort", to: :non_sort
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
loc_mods-0.2.7 lib/loc_mods/subject_title_info.rb
loc_mods-0.2.6 lib/loc_mods/subject_title_info.rb
loc_mods-0.2.5 lib/loc_mods/subject_title_info.rb