Make it protected instead of private?
From: [email protected]
[mailto:[email protected]] On Behalf Of Orion Edwards
Sent: Monday, May 04, 2009 4:32 PM
To: [email protected]
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
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core