[Ironruby-core] .Net<->IR Object Mapping

Shay Friedman lists at ruby-forum.com
Tue Jun 9 17:05:00 EDT 2009


I can't get it to work... What am I doing wrong?

This is my C# code:
namespace IRTests
{
  public class IRTest
  {
    private void MyMethod() {
      Console.WriteLine("Hi from C#");
    }
  }
}

And this is the IR console:

>>> t = IRTests::IRTest.new
=> IRTests.IRTest
>>> t.my_method
:0: undefined method `my_method' for IRTests.IRTest:IRTests::IRTest 
(NoMethodError)

>>> t.method(:my_method)
D:\IronRuby\GitRepository\ironruby\Merlin\Main\Languages\Ruby\Libraries.LCA_RESTRICTED\Builtins\KernelOps.cs:1437:in 
`method': undefined method `my_method' for class `IRTests::IRTest' 
(NameError)        from :0

Thanks!
Shay.
----------------------------
Shay Friedman
http://www.ironshay.com
Follow me: http://twitter.com/ironshay
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list