Skip to content

Instantly share code, notes, and snippets.

@alloy-d
Created August 6, 2014 18:15
Show Gist options
  • Save alloy-d/d3c9a6f5f9532e96e597 to your computer and use it in GitHub Desktop.
Save alloy-d/d3c9a6f5f9532e96e597 to your computer and use it in GitHub Desktop.
YOLOHash: stop caring about all that "strings vs symbols" nonsense
class YOLOHash < Hash
def [](key)
super(key.send((rand(2) % 2 == 1) ? :to_sym : :to_s))
end
def []=(key,val)
super(key.send((rand(2) % 2 == 1) ? :to_sym : :to_s), val)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment