Module: Mml::Base::Mo

Included in:
V2::Mo, V3::Mo, V4::Mo
Defined in:
lib/mml/base/mo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/mml/base/mo.rb', line 8

def self.included(klass)
  klass.class_eval do
    attribute :value, :string
    attribute :mathcolor, :string
    attribute :mathbackground, :string
    attribute :mathvariant, :string
    attribute :mathsize, :string
    attribute :form, :string
    attribute :lspace, :string
    attribute :rspace, :string
    attribute :stretchy, :string
    attribute :symmetric, :string
    attribute :maxsize, :string
    attribute :minsize, :string
    attribute :fence, :string
    attribute :largeop, :string
    attribute :movablelimits, :string
    attribute :accent, :string
    attribute :linebreak, :string
    attribute :lineleading, :string
    attribute :linebreakstyle, :string
    attribute :linebreakmultchar, :string
    attribute :indentalign, :string
    attribute :indentshift, :string
    attribute :indenttarget, :string
    attribute :indentalignfirst, :string
    attribute :indentshiftfirst, :string
    attribute :indentalignlast, :string
    attribute :indentshiftlast, :string

    # rubocop:disable Metrics/BlockLength
    xml do
      namespace Mml::Namespace
      element "mo"

      map_content to: :value
      map_attribute "form", to: :form
      map_attribute "accent", to: :accent
      map_attribute "lspace", to: :lspace
      map_attribute "rspace", to: :rspace
      map_attribute "maxsize", to: :maxsize
      map_attribute "minsize", to: :minsize
      map_attribute "fence", to: :fence
      map_attribute "largeop", to: :largeop
      map_attribute "stretchy", to: :stretchy
      map_attribute "linebreak", to: :linebreak
      map_attribute "symmetric", to: :symmetric
      map_attribute "mathcolor", to: :mathcolor
      map_attribute "mathvariant", to: :mathvariant
      map_attribute "mathsize", to: :mathsize
      map_attribute "lineleading", to: :lineleading
      map_attribute "indentalign", to: :indentalign
      map_attribute "indentshift", to: :indentshift
      map_attribute "indenttarget", to: :indenttarget
      map_attribute "movablelimits", to: :movablelimits
      map_attribute "linebreakstyle", to: :linebreakstyle
      map_attribute "mathbackground", to: :mathbackground
      map_attribute "indentalignlast", to: :indentalignlast
      map_attribute "indentshiftlast", to: :indentshiftlast
      map_attribute "indentalignfirst", to: :indentalignfirst
      map_attribute "indentshiftfirst", to: :indentshiftfirst
      map_attribute "linebreakmultchar", to: :linebreakmultchar
    end
    # rubocop:enable Metrics/BlockLength
  end
end