H
Harold Hausman
irb(main):001:0> foo = Object.new
=> #<Object:0x2b9bb88>
irb(main):002:0> foo.instance_eval "3.times{ puts 'boom' }"
boom
boom
boom
=> 3
irb(main):003:0> foo.instance_eval "3.times{ puts 'boom' \n}"
boom
boom
boom
=> 3
irb(main):004:0> foo.instance_eval "3.times\n{ puts 'boom' \n}"
SyntaxError: (eval):3:in `irb_binding': compile error
(eval):2: syntax error
{ puts 'boom'
^
(eval):3: syntax error
from (irb):4
#is there a rule that says that the opening curly brace has to be on
the same line?
Any help appreciated,
-Harold
=> #<Object:0x2b9bb88>
irb(main):002:0> foo.instance_eval "3.times{ puts 'boom' }"
boom
boom
boom
=> 3
irb(main):003:0> foo.instance_eval "3.times{ puts 'boom' \n}"
boom
boom
boom
=> 3
irb(main):004:0> foo.instance_eval "3.times\n{ puts 'boom' \n}"
SyntaxError: (eval):3:in `irb_binding': compile error
(eval):2: syntax error
{ puts 'boom'
^
(eval):3: syntax error
from (irb):4
#is there a rule that says that the opening curly brace has to be on
the same line?
Any help appreciated,
-Harold