From: Ralph Mason Date: 2001-12-22T11:38:43+09:00 Subject: [ruby-talk:29280] Instance Subclassing This is a multi-part message in MIME format. ------=_NextPart_000_03F1_01C18AFE.D0A7D1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I would like to do an instance subclass. e.g. class MyClass < Win32OLE.new("myserver.myclass") //More methods here end Is there any way to accomplish this? I know I can fake it using = method_missing, but the above seems far more rubyish. This probably seems like a strange thing to do, but here is the reason. = I want to subclass com objects using RubyCOM so that I can add methods = to existing com objects. These objects are then exposed as the = originals. This means you can extend objects written in other languages = using ruby, a very desirable thing to do with legacy code. Ralph ------=_NextPart_000_03F1_01C18AFE.D0A7D1F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I would like to do an instance=20 subclass.
 
e.g.
 
class MyClass <=20 Win32OLE.new("myserver.myclass")
 
//More methods here
 
end
 
Is there any way to accomplish = this?  I know I can fake it using method_missing, but the = above seems=20 far more rubyish.
 
This probably seems like a strange = thing to do, but=20 here is the reason.  I want to subclass com objects using RubyCOM = so that I=20 can add methods to existing com objects. These objects are then exposed = as the=20 originals.  This means you can extend objects written in other = languages=20 using ruby, a very desirable thing to do with legacy code.
 
 
Ralph
 
------=_NextPart_000_03F1_01C18AFE.D0A7D1F0--