Skip to content

Instantly share code, notes, and snippets.

@stevegraham
Created November 4, 2010 18:34
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 stevegraham/662917 to your computer and use it in GitHub Desktop.
Save stevegraham/662917 to your computer and use it in GitHub Desktop.
def method_missing(meth, *args, &blk)
if value.include? meth
class << self; self; end.instance_eval { define_method(meth) { value[meth] } }
send meth
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment