Skip to content

Instantly share code, notes, and snippets.

@marcel
Created February 10, 2011 23:19
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 marcel/821588 to your computer and use it in GitHub Desktop.
Save marcel/821588 to your computer and use it in GitHub Desktop.
Nested default procs
intersections = Hash.new do |h, k|
# k = segment type 1
h[k] = Hash.new do |h, k|
# k = segment value 1
h[k] = Hash.new do |h, k|
# k = segment type 2
h[k] = {}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment