Module: Tbx::DataElement

Included in:
Admin, AdminNote, Descrip, DescripNote, Ref, TermNote, Transac, TransacNote
Defined in:
lib/tbx/data_element.rb

Overview

Shared attribute declarations for TBX data-category elements.

Injects the common attributes defined by the ‘IDLangTgtDtyp` attribute class + `type` + text content pattern from TBXcoreStructV03.rng.

Examples:

Usage in a data-category element

class Admin < Lutaml::Model::Serializable
  include Tbx::DataElement
  include Tbx::DataElement::InlineContent

  xml do
    root "admin"
    ...
  end
end

Defined Under Namespace

Modules: InlineContent

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/tbx/data_element.rb', line 20

def self.included(base)
  base.class_eval do
    attribute :id, :string
    attribute :lang, Lutaml::Xml::W3c::XmlLangType
    attribute :target, :string
    attribute :datatype, :string
    attribute :type, :string
    attribute :content, :string, collection: true
  end
end