MathML::SubSup

Attributes

sub[R]
sup[R]
body[R]

Public Class Methods

new(display_style, body) click to toggle source
    # File lib/math_ml/element.rb, line 87
87:                 def initialize(display_style, body)
88:                         super("mrow")
89:                         as_display_style if display_style
90:                         @body = body
91:                 end

Public Instance Methods

sub=(sub) click to toggle source
     # File lib/math_ml/element.rb, line 119
119:                 def sub=(sub)
120:                         @sub = sub
121:                         update
122:                 end
sup=(sup) click to toggle source
     # File lib/math_ml/element.rb, line 124
124:                 def sup=(sup)
125:                         @sup = sup
126:                         update
127:                 end

Private Instance Methods

update() click to toggle source
     # File lib/math_ml/element.rb, line 113
113:                 def update
114:                         update_name
115:                         update_contents
116:                 end
update_contents() click to toggle source
     # File lib/math_ml/element.rb, line 105
105:                 def update_contents
106:                         contents.clear
107:                         contents << @body
108:                         contents << @sub if @sub
109:                         contents << @sup if @sup
110:                 end
update_name() click to toggle source
     # File lib/math_ml/element.rb, line 93
 93:                 def update_name
 94:                         if @sub || @sup
 95:                                 name = "m"
 96:                                 name << (@sub ? (@display_style ? "under" : "sub") : "")
 97:                                 name << (@sup ? (@display_style ? "over" : "sup") : "")
 98:                         else
 99:                                 name = "mrow"
100:                         end
101:                         self.name = name
102:                 end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.