Skip to content

Instantly share code, notes, and snippets.

@headius
Created March 4, 2015 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/21520d248e57717fa4b8 to your computer and use it in GitHub Desktop.
Save headius/21520d248e57717fa4b8 to your computer and use it in GitHub Desktop.
def test_hash
z = nil
x = Hash.new{|h,kk| z = kk; h[kk] = kk*2}
z = 0
assert_equal(44, x[22])
assert_equal(22, z)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment