In Ruby, when I do something like this:
class Foo
...
def initialize( var )
@var = var
end
...
end
Then if I return a foo
in console I get this object representation:
#<Foo:0x12345678910234 @var=...........>
Sometimes I have an instance variable that is a long hash or something and it makes reading the rest of the object much more difficult.
My question is: is there a way to set an instance variable in an object to "private" or otherwise invisible so that it won't be printed as part of the object representation if that object is returned in the console?
Thanks!