RubyCLR uses method_missing to dynamically bind and generate shim methods to call CLR methods. But what happens if there’s a name conflict with a method in a base class or a mixin?
I just ran into this today while updating all of the samples to run on the latest bits. Since I’m now integrating ActiveRecord support into RubyCLR, I found that calls to XamlReader.load() wouldn’t work. Digging a bit deeper, this was due to ActiveSupport defining a load method on the Object class. The way to fix this problem is to simply call XamlReader.Load, which is the “real” name of the method (as defined in the library).
Now, how can I make this experience suck less for less experienced users? Should I reflect over all of the methods of the CLR type when I create the Ruby shadow class for the CLR class and issue a ‘warning’ when it discovers method conflicts?
Suggestions welcome.