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
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
119 def sub=(sub)
120         @sub = sub
121         update
122 end
sup=(sup) click to toggle source
    # File lib/math_ml/element.rb
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
113 def update
114         update_name
115         update_contents
116 end
update_contents() click to toggle source
    # File lib/math_ml/element.rb
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
 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