Works just fine for me. How are you starting up the console? Here's my method: [201] > ir -X:PrivateBinding IronRuby 0.5.0.0 on .NET 2.0.50727.4918 Copyright (c) Microsoft Corporation. All rights reserved.
>>> require 'temp1' => true >>> IRTests::IRTest.new.my_method Hi from C# => nil >>> JD ...there is no try > -----Original Message----- > From: ironruby-core-boun...@rubyforge.org [mailto:ironruby-core- > boun...@rubyforge.org] On Behalf Of Shay Friedman > Sent: Tuesday, June 09, 2009 2:05 PM > To: ironruby-core@rubyforge.org > Subject: Re: [Ironruby-core] .Net<->IR Object Mapping > > 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/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core@rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core _______________________________________________ Ironruby-core mailing list Ironruby-core@rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core