lasitha
2/23/2009 5:05:00 AM
On Mon, Feb 23, 2009 at 10:06 AM, Zayd Connor <devrubygem@gmail.com> wrote:
> How is the a =... invocation wrong? Just coming from a curious ruby
> beginner
Compare the value of a in both cases (in irb):
01> a = Object.new
--> #<Object:0x732e7c>
02> a.instance_eval do
03> @names = ["you", "me"]
04> end
--> ["you", "me"]
05> a
--> #<Object:0x732e7c @names=["you", "me"]>
06> a = Object.new.instance_eval do
07> @names = ["you", "me"]
08> end
--> ["you", "me"]
09> a
--> ["you", "me"]
Does that help?
lasitha