I had a bit of a surprise with the following
class Foo
def bar(value)
@bar = value.upcase
end
end
f = Foo.new
my_bar = (f.bar = "bar")
I initially thought that my_bar would == "BAR" but in fact it equals
"bar". It seems no matter what the final value of the bar= method is
the return value is always the parameters. First time I've run into
this so I thought I would share and ask if anyone can think of anyway
to get around this?
Farrel