Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Created November 19, 2008 20:13
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 Oshuma/26675 to your computer and use it in GitHub Desktop.
Save Oshuma/26675 to your computer and use it in GitHub Desktop.
# tree = Node.new
# tree.branch.leaf.value = 'Hello World!'
class Node < Hash
attr_accessor :value
def method_missing(key)
self[key]==nil ? self[key]=Node.new : self[key]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment