Skip to content

Instantly share code, notes, and snippets.

@peijiehu
Created March 2, 2015 20:07
Show Gist options
  • Save peijiehu/595b13a92e333e356fab to your computer and use it in GitHub Desktop.
Save peijiehu/595b13a92e333e356fab to your computer and use it in GitHub Desktop.
override method_missing and accepts multiple arguments
def method_missing(method_sym, *arguments)
if arguments.empty?
puts method_sym
else
puts "#{method_sym}(#{arguments.join(',')})"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment