Skip to content

Instantly share code, notes, and snippets.

@yagince
Created April 23, 2013 13:29
Show Gist options
  • Select an option

  • Save yagince/5443552 to your computer and use it in GitHub Desktop.

Select an option

Save yagince/5443552 to your computer and use it in GitHub Desktop.
class Hash
def method_missing(name, *args)
self[name] || self[name.to_s] || super
end
end
hash = {a: "hoge"}
p hash.a
require_relative 'hash_extention'
hash2 = {a: "hash_extention2" }
p hash2.a
require_relative 'hash_extention02'
hash3 = {a: "hash_extention3" }
p hash3.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment