Class: Kozo::Types::Date
- Inherits:
-
Kozo::Type
- Object
- Kozo::Type
- Kozo::Types::Date
- Defined in:
- lib/kozo/types/date.rb
Class Method Summary collapse
Methods inherited from Kozo::Type
Class Method Details
.cast(value) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/kozo/types/date.rb', line 6 def self.cast(value) return unless value return value if value.is_a?(::Date) ::Date.parse(value) rescue ::Date::Error => e raise ArgumentError, e end |