Module: Mml::Base::Mtd

Included in:
V2::Mtd, V3::Mtd, V4::Mtd
Defined in:
lib/mml/base/mtd.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

NOTE: class_eval resolves constants in module’s lexical scope. Use fully qualified names (e.g., Mml::Namespace).



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/mml/base/mtd.rb', line 8

def self.included(klass)
  klass.class_eval do
    attribute :mathcolor, :string
    attribute :mathbackground, :string
    attribute :rowalign, :string
    attribute :columnalign, :string
    attribute :groupalign, :string
    attribute :rowspan, :integer
    attribute :columnspan, :integer

    xml do
      namespace Mml::Namespace
      element "mtd"
      mixed_content

      map_attribute "mathcolor", to: :mathcolor
      map_attribute "mathbackground", to: :mathbackground
      map_attribute "rowalign", to: :rowalign
      map_attribute "columnalign", to: :columnalign
      map_attribute "groupalign", to: :groupalign
      map_attribute "rowspan", to: :rowspan
      map_attribute "columnspan", to: :columnspan
    end
  end
end