Module: Mml::Base::UniversalPresentationAttributes

Defined in:
lib/mml/base/universal_presentation_attributes.rb

Overview

Universal MathML presentation attributes allowed on all presentation elements. These exist in MathML 3 and later (displaystyle, scriptlevel were introduced in v3).

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



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

def self.included(klass)
  klass.class_eval do
    include CommonAttributes

    attribute :displaystyle, :string
    attribute :scriptlevel, :string
    attribute :mathcolor, :string
    attribute :mathbackground, :string
    attribute :mathsize, :string

    xml do
      namespace Mml::Namespace
      map_attribute "displaystyle", to: :displaystyle
      map_attribute "scriptlevel", to: :scriptlevel
      map_attribute "mathcolor", to: :mathcolor
      map_attribute "mathbackground", to: :mathbackground
      map_attribute "mathsize", to: :mathsize
    end
  end
end