Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-04-04 Thread Laurent Sansonetti
Hi Mathias, On Apr 4, 2009, at 7:49 PM, Mathias Sulser wrote: I started working on this. I have a failing test case and figured a way to hook in the objc lookup inside the ivar_get function. However, I haven't figured out how I can call object_getInstanceVariable with an ROBJECT.. any hints

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-04-04 Thread Mathias Sulser
I started working on this. I have a failing test case and figured a way to hook in the objc lookup inside the ivar_get function. However, I haven't figured out how I can call object_getInstanceVariable with an ROBJECT.. any hints appreciated. Regards, Mathias On 3 Apr 2009, at 19:29, Laurent

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-04-03 Thread Laurent Sansonetti
On Apr 1, 2009, at 8:07 AM, Benjamin Stiglitz wrote: Is there a way to access instance variables defined in an Objective-C class from a Ruby extension? It is currently not implemented, but it's technically possible. A good work-around is to define accessors (properties) as John mentione

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-04-01 Thread Benjamin Stiglitz
Is there a way to access instance variables defined in an Objective-C class from a Ruby extension? It is currently not implemented, but it's technically possible. A good work-around is to define accessors (properties) as John mentioned. Maybe we need MacRuby::Runtime to bubble up the Obj

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-03-30 Thread Edward Hynes
Accessors, it's s obvious (after you all pointed the way ;^) Thanks, Ed ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-03-30 Thread Brian Chapados
In this case, you could use the KVC[1] (key-value coding) accessor (#valueForKey:) to access the ivar. class Example def methodB self.valueForKey("instVarB") end end [1]: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Compliant.html Brian On Mon, Mar

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-03-30 Thread Laurent Sansonetti
Hi John & Edward, On Mar 30, 2009, at 11:27 AM, John Shea wrote: Hello Edward, well since no one else has answered i will speculate a bit (it might provoke someone wiser). I assume that the Ruby and the Objective C class are magically married together perhaps via some sort of proxy class - si

Re: [MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-03-30 Thread John Shea
Hello Edward, well since no one else has answered i will speculate a bit (it might provoke someone wiser). I assume that the Ruby and the Objective C class are magically married together perhaps via some sort of proxy class - since you cant as far as i know add to an objective C class more instan

[MacRuby-devel] Accessing Obj-C InstVars from Ruby

2009-03-30 Thread Edward Hynes
Is there a way to access instance variables defined in an Objective-C class from a Ruby extension? I'm porting some of Apple's example code to MacRuby as a learning experience and would like to do so incrementally. Porting the code one class at a time works fine, but for some of the large