Skip to content

Instantly share code, notes, and snippets.

@nouse
Created June 2, 2011 16:04
Show Gist options
  • Save nouse/1004707 to your computer and use it in GitHub Desktop.
Save nouse/1004707 to your computer and use it in GitHub Desktop.
put method before object
module Kernel
def method_missing(name, *args, &block)
if args[0].respond_to?(name)
args[0].send(name, *args[1..-1], &block)
else
super
end
end
end
p upcase "little prince"
p reduce [1,2,3,4], 0, &:+
p a 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment