C
Casimir
So I created my own subclass of REXML:
ocument. Like this:
#begin example
class MyDoc < REXML:
ocument
def initialize ()
@tree = super("<docc></docc>")
puts @tree.class
@name = tree.root.add_element("test")
end
#end example
The above results in "undefined method `root' for nil:NilClass
(NoMethodError)"
Also trying 'super.new("<docc></docc>")' doesnt work.
I can get it working by writing @tree =
REXML:
ocument("<docc></docc>"), but then my nice class will only be a
container, not a subclass.
How can I actually get it working? Ie. get my very own subclass of
REXML:
ocument with my very own initialize.
Yes, its a foggy day and inheritance seems to escape me...
Csmr
#begin example
class MyDoc < REXML:
def initialize ()
@tree = super("<docc></docc>")
puts @tree.class
@name = tree.root.add_element("test")
end
#end example
The above results in "undefined method `root' for nil:NilClass
(NoMethodError)"
Also trying 'super.new("<docc></docc>")' doesnt work.
I can get it working by writing @tree =
REXML:
container, not a subclass.
How can I actually get it working? Ie. get my very own subclass of
REXML:
Yes, its a foggy day and inheritance seems to escape me...
Csmr