Sha256: 63f77ebb43cc8573844e4b2716f2e74d7e8b91101a704295e0c45fa6da663571

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module Niso
  module Jats
    class StringName < Lutaml::Model::Serializable
      attribute :content, :string
      attribute :content_type, :string
      attribute :id, :string
      attribute :name_style, :string, default: -> { "western" }
      attribute :specific_use, :string
      attribute :lang, :string
      attribute :degrees, Degrees, collection: true
      attribute :given_names, GivenNames, collection: true
      attribute :prefix, Prefix, collection: true
      attribute :surname, Surname, collection: true
      attribute :suffix, Suffix, collection: true

      xml do
        root "string-name"

        map_content to: :content
        map_attribute "content-type", to: :content_type
        map_attribute "id", to: :id
        map_attribute "name-style", to: :name_style
        map_attribute "specific-use", to: :specific_use
        map_attribute "lang", to: :lang, namespace: "http://www.w3.org/XML/1998/namespace", prefix: "xml"
        map_element "degrees", to: :degrees
        map_element "given-names", to: :given_names
        map_element "prefix", to: :prefix
        map_element "surname", to: :surname
        map_element "suffix", to: :suffix
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
niso-jats-0.1.1 lib/niso/jats/string_name.rb