E
Evan Moseman
If I am perusing through the each_object loop and find the objects I'm
interested in, how can I get their variable names?
Thanks!
interested in, how can I get their variable names?
Thanks!
Evan said:If I am perusing through the each_object loop and find the objects I'm
interested in, how can I get their variable names?
Thanks!
Evan said:If I am perusing through the each_object loop and find the objects I'm
interested in, how can I get their variable names?
Thanks!
You can't. Variables are just labels for objects. What if you have
something like this:
foo = MyClass.new
bar = foo
What's the variable name of the object? What about
ary = []
ary << bar
Now what's the variable name? What about this
def f(v)
puts v
end
f(ary[0])
Now what's the variable name?
interested in, how can I get their variable names?
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.