[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Question about linked library inheritance

Jeffrey Moss

12/13/2004 6:22:00 PM

Here is a test case I came up with to demonstrate the problem I'm having. libxml is a shared object, and when I try and inherit from the Document class, it won't let me override the initializer. Is this expected behavior or am I doing something wrong?


require 'xml/libxml'

class Test < XML::Document
def initialize(params)
print params
super('1.0')
end
end

object = Test.new('123')
print object.inspect

output:
<?xml version="123"?>

expected output:
<?xml version="1.0"?>