Class: Dryml::Parser::Elements

Inherits:
REXML::Elements
  • Object
show all
Defined in:
lib/dryml/parser/elements.rb

Instance Method Summary collapse

Instance Method Details

#add(element = nil) ⇒ Object

Override to ensure DRYML elements are created



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/dryml/parser/elements.rb', line 6

def add(element=nil)
  rv = nil
  if element.nil?
    Dryml::Parser::Element.new("", self, @element.context)
  elsif not element.kind_of?(Element)
    Dryml::Parser::Element.new(element, self, @element.context)
  else
    @element << element
    element.context = @element.context
    element
  end
end