Having another go at some WCF stuff again. I have a C# method that accepts a type. I want to pass it an interface. interface IMyInterface; public void DoStuff( Type t ); DoStuff( typeof(IMyInterface) );>From the ruby side, I''m importing both IMyInterface and DoStuff from C#, Ijust want to call the method from ruby. When I do this: do_stuff( IMyInterface ); I get "can''t convert Module into System::Type" If I try pass in a class, I get the similar "can''t convert Class into System::Type" So, is there a way to get a .NET Type from a ruby object, particularly an interface/module? (it is a real .NET type as it''s loaded from a C# dll) Any help is greatly appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090306/d233b51a/attachment.html>
IMyInterface.to_clr_type should work. Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Orion Edwards Sent: Thursday, March 05, 2009 1:59 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Typeof ?? Having another go at some WCF stuff again. I have a C# method that accepts a type. I want to pass it an interface. interface IMyInterface; public void DoStuff( Type t ); DoStuff( typeof(IMyInterface) );>From the ruby side, I''m importing both IMyInterface and DoStuff from C#, I just want to call the method from ruby.When I do this: do_stuff( IMyInterface ); I get "can''t convert Module into System::Type" If I try pass in a class, I get the similar "can''t convert Class into System::Type" So, is there a way to get a .NET Type from a ruby object, particularly an interface/module? (it is a real .NET type as it''s loaded from a C# dll) Any help is greatly appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090305/3fb7b076/attachment.html>
IMyInterface.to_clr_type --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim On Thu, Mar 5, 2009 at 10:59 PM, Orion Edwards <orion.edwards at gmail.com>wrote:> Having another go at some WCF stuff again. > I have a C# method that accepts a type. I want to pass it an interface. > > interface IMyInterface; > public void DoStuff( Type t ); > > DoStuff( typeof(IMyInterface) ); > > From the ruby side, I''m importing both IMyInterface and DoStuff from C#, I > just want to call the method from ruby. > > When I do this: > > do_stuff( IMyInterface ); > > I get "can''t convert Module into System::Type" > > If I try pass in a class, I get the similar "can''t convert Class into > System::Type" > > So, is there a way to get a .NET Type from a ruby object, particularly an > interface/module? (it is a real .NET type as it''s loaded from a C# dll) > > Any help is greatly appreciated. Thanks. > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090306/b3e5f8b1/attachment.html>