I'd like to create a subclass of XML::Document. However, I'm having
trouble figuring out how I would instantiate my subclass because parsing
requires Parser.parse() which returns an XML::Document instead of
My::Subclass. Unfortunately, Ruby doesn't have a way of changing the
class of an object.
I'd like to create a subclass of XML::Document. However, I'm having
trouble figuring out how I would instantiate my subclass because parsing
requires Parser.parse() which returns an XML::Document instead of
My::Subclass. Unfortunately, Ruby doesn't have a way of changing the
class of an object.
A
You may be able to produce what you want by defining a module and
extending the Document with it:
ardent:~ danj$ irb
irb(main):001:0> class A
irb(main):002:1> end
=> nil
irb(main):003:0> module B
irb(main):004:1> def hello
irb(main):005:2> puts "hello"
irb(main):006:2> end
irb(main):007:1> end
Hey Mark,
I'd like to create a subclass of XML::Document. However, I'm having
trouble figuring out how I would instantiate my subclass because parsing
requires Parser.parse() which returns an XML::Document instead of
My::Subclass. Unfortunately, Ruby doesn't have a way of changing the
class o
Not applicable to libxml, but in case anyone missed it:
http://www.ruby-lang.org/en/news/2008/08/23/dos-vulnerability-in-rexml/
-sc
--
Sean Chittenden
[EMAIL PROTECTED]
___
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/m