Class MathML::SubSup
In: lib/math_ml/element.rb
Parent: Element

Methods

new   sub=   sup=   update   update_contents   update_name  

Attributes

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

Public Class methods

[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

[Source]

     # File lib/math_ml/element.rb, line 119
119:                 def sub=(sub)
120:                         @sub = sub
121:                         update
122:                 end

[Source]

     # File lib/math_ml/element.rb, line 124
124:                 def sup=(sup)
125:                         @sup = sup
126:                         update
127:                 end

Private Instance methods

[Source]

     # File lib/math_ml/element.rb, line 113
113:                 def update
114:                         update_name
115:                         update_contents
116:                 end

[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

[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

[Validate]