Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Created March 28, 2012 14:59
Show Gist options
  • Save chewmanfoo/2226874 to your computer and use it in GitHub Desktop.
Save chewmanfoo/2226874 to your computer and use it in GitHub Desktop.
impress[prod]>> inner = Array.new
=> []
impress[prod]>> inner.push {"a" => "b"}
SyntaxError: compile error <--- why???
(irb):3: syntax error, unexpected tASSOC, expecting '}'
inner.push {"a" => "b"}
^
from (irb):3
impress[prod]>> inner.push {{"a" => "b"}}
=> []
impress[prod]>> inner
=> []
impress[prod]>> ii = Hash.new
=> {}
impress[prod]>> ii = {"a" => "b"}
=> {"a"=>"b"}
impress[prod]>> inner.push ii <--- same thing?
=> [{"a"=>"b"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment