jeudi 12 mai 2016

Is there a way in Ruby to retrieve all the objects referencing a variable with the aid of reflection?

Suppose in Ruby I have [a,b,c] and [g,h,a]

Is there some reflective programming technique allowing me to ask:

What objects are referencing "a"?

and getting as an answer something like:

object_id:123123 (Array)

object_id:234234 (Array)

Don't say it's smelly :) I am just curious to know if it's possible...





Aucun commentaire:

Enregistrer un commentaire