How do you list the currently available objects in the current scope in ruby?
I’m not entirely sure of what you mean by the ‘current objects’. You can iterate over ObjectSpace, as has been mentioned already. But here are a few other methods. local_variables instance_variables global_variables class_variables constants There’s one gotcha. They must be called at the right scopes. So right in IRB, or in an object instance or … Read more