Make it protected instead of private?

From: ironruby-core-boun...@rubyforge.org 
[mailto:ironruby-core-boun...@rubyforge.org] On Behalf Of Orion Edwards
Sent: Monday, May 04, 2009 4:32 PM
To: ironruby-core@rubyforge.org
Subject: [Ironruby-core] Clr Interop and private member variables

I have the following C# class

namespace MyNamespace
{
  public class MyObject
  {
    private string m_Name;
  }
}

and I'm extending it from IronRuby

class MyNameSpace::MyObject
  def printme
    puts m_Name
  end
end

When I try to run this, I get undefined method `m_Name' for 
MyNameSpace::MyObject (NoMethodError)
Other normal method/property calls work fine.

Likewise if I do MyObject.new.instance_eval{ m_Name } the same error occurs.

Is this because IronRuby is trying to call a method instead of read a member 
variable, or is it because the variable is private?
Either way, is there a way I can fix this? (short of falling back to 
InvokeMember...)

Thanks, Orion.
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to