Class: MathML::Table
- Inherits:
-
Element
- Object
- EimXML::Element
- XMLElement
- Element
- MathML::Table
- Defined in:
- lib/math_ml/element.rb
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
- #aligns=(a) ⇒ Object
- #hlines=(a) ⇒ Object
-
#initialize ⇒ Table
constructor
A new instance of Table.
- #set_align_attribute(name, a, default) ⇒ Object
- #vlines=(a) ⇒ Object
Methods inherited from Element
Methods inherited from XMLElement
Constructor Details
#initialize ⇒ Table
Returns a new instance of Table.
191 192 193 |
# File 'lib/math_ml/element.rb', line 191 def initialize super('mtable') end |
Instance Method Details
#aligns=(a) ⇒ Object
211 212 213 |
# File 'lib/math_ml/element.rb', line 211 def aligns=(a) set_align_attribute('columnalign', a, Align::CENTER) end |
#hlines=(a) ⇒ Object
219 220 221 |
# File 'lib/math_ml/element.rb', line 219 def hlines=(a) set_align_attribute('rowlines', a, Line::NONE) end |
#set_align_attribute(name, a, default) ⇒ Object
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/math_ml/element.rb', line 195 def set_align_attribute(name, a, default) if a.is_a?(Array) && a.size > 0 value = '' a.each do |i| value << (' ' + i) end if value =~ /^( #{default})*$/ @attributes.delete(name) else @attributes[name] = value.strip end else @attributes.delete(name) end end |