I have a string which might or might not be a valid date.
I want a clean and simple way to validate whilst keeping Rubocop happy.
# TODO: Welcome suggestions for a better way to deal with this...
# rubocop:disable HandleExceptions
def self.valid_date?(date)
Date.parse(date)
rescue ArgumentError
end
# rubocop:enable HandleExceptions
I actually feel like this is a clean way to achieve what I need, but is there a way to resolve whilst still keeping rubocop happy?