ruby / date

A subclass of Object includes Comparable module for handling dates.
Other
70 stars 35 forks source link

Check for numeric arguments in constructors #9

Closed jeremyevans closed 5 years ago

jeremyevans commented 5 years ago

Previously, the type of these arguments were not checked, leading to NoMethodErrors in some cases, and TypeErrors in other cases, but not showing what field was having the problems. This change makes it so the field with the problem is included in the error message.

For the valid_*? methods, this changes them to return false if one of the arguments that should be numeric is not.

Fixes Ruby Bug 11935 Fixes Ruby Misc 15298

CJKinni commented 5 years ago

Thanks for addressing this! It was my first open source bug report and patch suggestion, and it's great to see it being resolved!