Method: Latexmath::XML::Element#initialize
- Defined in:
- lib/latexmath/xml/element.rb
#initialize(parent, tag, attributes = {}) ⇒ Element
Returns a new instance of Element.
4 5 6 7 8 9 10 11 |
# File 'lib/latexmath/xml/element.rb', line 4 def initialize(parent, tag, attributes = {}) @element = Ox::Element.new(tag) attributes.each do |key, value| @element[key] = value end @parent = parent.is_a?(Latexmath::XML::Element) ? parent.element : parent @parent << @element end |