Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created September 24, 2013 21:07
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 phiggins/6691237 to your computer and use it in GitHub Desktop.
Save phiggins/6691237 to your computer and use it in GitHub Desktop.
Kernel require monkeypatch
module Kernel
def required(arg=nil)
method = caller_locations(1,1)[0].label
raise ArgumentError.new("required parameter #{arg.to_sym.inspect + ' ' if arg}not passed to method #{method}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment