Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/valid-date.rb

Instance Method Summary collapse

Instance Method Details

#valid_date?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/valid-date.rb', line 4

def valid_date?
  unless self == ''
    begin
      date = self.to_date
      result = true
    rescue Exception => e
      result = false
    end
  end
  
  result
end