Sha256: ce5d395556900df8815bddd1c192550a8b2df30cebf3c502e4a863f58fb75c80

Contents?: true

Size: 233 Bytes

Versions: 1

Compression:

Stored size: 233 Bytes

Contents

require 'date'

module UniversalValidators
  class DateTimeValidator
    def initialize(datetime)
      @datetime = datetime.to_s
    end

    def valid?
      DateTime.parse(@datetime).is_a?(DateTime) rescue false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
universal_validators-1.0.0 lib/universal_validators/date_time_validator.rb