Module: RAXB

Defined in:
lib/raxb.rb

Defined Under Namespace

Classes: Element, ElementList

Instance Method Summary collapse

Instance Method Details

#create(tag_name) ⇒ Object



16
17
18
# File 'lib/raxb.rb', line 16

def create(tag_name)
  return Element.new(tag_name)
end

#unmarshal(source) ⇒ Object

This function is used to create a RAXB object from a source document (either REXML::Document, or anything accepted by the REXML::Document constructor).



8
9
10
11
12
13
14
# File 'lib/raxb.rb', line 8

def unmarshal(source)
  if source.kind_of? REXML::Element
    return Element.new( source )
  else
    return Element.new( REXML::Document.new(source) )
  end
end