Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created April 15, 2014 22:24
Show Gist options
  • Save Atalanta/10783385 to your computer and use it in GitHub Desktop.
Save Atalanta/10783385 to your computer and use it in GitHub Desktop.
[14] pry(main)> def zorak_hash(keys)
[14] pry(main)* h = {}
[14] pry(main)* keys.times {|e| h[e.succ.to_s] = nil }
[14] pry(main)* h
[14] pry(main)* end
=> :zorak_hash
[15] pry(main)> zorak_hash(4)
=> {"1"=>nil, "2"=>nil, "3"=>nil, "4"=>nil}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment