lib/rest_model/serialization/date.rb in rest_model-0.1.9 vs lib/rest_model/serialization/date.rb in rest_model-0.1.10
- old
+ new
@@ -1,18 +1,18 @@
class RestModel
module Serialization
class Date
def self.serialize(value)
::Date.parse value
- rescue ArgumentError
+ rescue
raise SerializationError, "value '#{value}' is an invalid date"
end
def self.desserialize(value)
date = value.kind_of?(::Date) ? value : ::Date.parse(value)
format = RestModel::Configuration.date_format
format ? date.strftime(format) : date.to_s
- rescue ArgumentError
+ rescue
raise SerializationError, "value '#{value}' is an invalid date"
end
end
end
end