A
Alexandre Hudelot
Hello, how does one set a pointer to foo using an id string obtained
through foo.object_id for instance?
Thanks in advance
through foo.object_id for instance?
Thanks in advance
Hello, how does one set a pointer to foo using an id string obtained
through foo.object_id for instance?
Thanks in advance
Alexandre said:Hello, how does one set a pointer to foo using an id string obtained
through foo.object_id for instance?
Thanks in advance
Alexandre said:Hello, how does one set a pointer to foo using an id string obtained
through foo.object_id for instance?
Thanks in advance
Considering that object ids are only valid throughout one interpreter
run... I'm curious: why pass around the object id instead of the object
itself?
Ken said:Have a look at how weakref.rb is implemented. It keeps track of the
objects it's referencing by object id, because the garbage collector can't
follow those, but the references can get their objects back
using ObjectSpace._id2ref (assuming they haven't been garbage collected).
David said:Considering that object ids are only valid throughout one interpreter
run... I'm curious: why pass around the object id instead of the object
itself?
David Vallner
Alexandre said:Thanks for the information!
I'm having trouble passing an object reference from a template (a form)
to a controller method, what I've managed to return is the object's id
string.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.