psantos10/Validation

View on GitHub
lib/resize/rules/is_date.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'date'

module Resize
  module Validation
    module Rules
      module IsDate
        private
          def is_valid?(input)
            begin
              Date.parse(input)
              return true
            rescue ArgumentError
              return false
            end
          end
      end
    end
  end
end