class MathML::SubSup
Attributes
body[R]
sub[R]
sup[R]
Public Class Methods
new(display_style, body)
click to toggle source
Calls superclass method
# File lib/math_ml/element.rb, line 87 def initialize(display_style, body) super("mrow") as_display_style if display_style @body = body end
Public Instance Methods
sub=(sub)
click to toggle source
# File lib/math_ml/element.rb, line 119 def sub=(sub) @sub = sub update end
sup=(sup)
click to toggle source
# File lib/math_ml/element.rb, line 124 def sup=(sup) @sup = sup update end
Private Instance Methods
update()
click to toggle source
# File lib/math_ml/element.rb, line 113 def update update_name update_contents end
update_contents()
click to toggle source
# File lib/math_ml/element.rb, line 105 def update_contents contents.clear contents << @body contents << @sub if @sub contents << @sup if @sup end
update_name()
click to toggle source
# File lib/math_ml/element.rb, line 93 def update_name if @sub || @sup name = "m" name << (@sub ? (@display_style ? "under" : "sub") : "") name << (@sup ? (@display_style ? "over" : "sup") : "") else name = "mrow" end self.name = name end