Created
September 24, 2013 21:07
-
-
Save phiggins/6691237 to your computer and use it in GitHub Desktop.
Kernel require monkeypatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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