Module: Dcc::Base::Formula

Included in:
V2::Formula, V3::Formula
Defined in:
lib/dcc/base/formula.rb

Overview

dcc:formulaType — formula expression. Contains latex string, mathml (a typed Mml::V3::Math model), or legacy siunitx.

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/dcc/base/formula.rb', line 10

def self.included(klass)
  klass.class_eval do
    attribute :id, :string
    attribute :ref_id, :string
    attribute :ref_type, :string
    attribute :latex, :string
    attribute :mathml, ::Mml::V3::Math
    attribute :siunitx, :string

    xml do
      namespace ::Dcc::Namespace::Dcc
      element "formula"
      map_attribute "id", to: :id
      map_attribute "refId", to: :ref_id
      map_attribute "refType", to: :ref_type
      map_element "latex", to: :latex
      map_element "mathml", to: :mathml
      map_element "siunitx", to: :siunitx
    end
  end
end