Sha256: 35c3b4dad43e1d6e23f8e9712b71ba16dc8adf1025dd14aeb7319b6192e2cfab

Contents?: true

Size: 219 Bytes

Versions: 2

Compression:

Stored size: 219 Bytes

Contents

module ValidateParams
  class Types
    class DateTime
      def self.valid?(value)
        Time.at(Integer(value))
        true
      rescue ArgumentError, TypeError
        false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
validate-params-0.6.1 lib/validate_params/types/date_time.rb
validate-params-0.6.0 lib/validate_params/types/date_time.rb