[Ironruby-core] Deriving from framework class with Initialize method

Stefan Dobrev stefan.dobrev at gmail.com
Sun Sep 7 15:11:08 EDT 2008

Hi guys,

I was trying to run the following code:

*class MyObj < DependencyObject

obj = MyObj.new*

Where DepenencyObject comes from the WPF stack (WindowsBase.dll). However
this fails on the *MyObj.new* line with strange error that wrong arguments
or types are passed to initialize method. After some digging I found that
DependencyObject have a private method Initialize which makes the problem.
Rewriting the code like this makes it work:

*class MyObj < DependencyObject
  def initialize

May be method resolution somehow get messed up.
Sample file attached.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080907/43f9a2b3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: init_issues.rb
Type: application/octet-stream
Size: 406 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080907/43f9a2b3/attachment.obj>

More information about the Ironruby-core mailing list