Sha256: 521277c95b1164e6993dcc567f36f4cd4d259954f742c754ee9e2f6ccca2149c

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

# frozen_string_literal: true

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

      xml do
        root "name"

        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 "surname", to: :surname
        map_element "given-names", to: :given_names
        map_element "prefix", to: :prefix
        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/name.rb