In my code, I usually use the following setting:
module MyLib
VERSION = "0.1.1"
ERROR = [
"You can either give one arg and a block or two args, not both.",
"Yadda yadda..."
]
end
Then somewhere in my code:
def my_method(*args, &blk)
raise(ArgumentError, MyLib::ERROR[0]) if (...condition snipped...)
end
Is there a better way to identify error messages?
source
share