Module: PROIEL::Utilities

Defined in:
lib/proiel/utils.rb

Class Method Summary collapse

Class Method Details

.xmlschema_datetime?(s) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
13
# File 'lib/proiel/utils.rb', line 3

def self.xmlschema_datetime?(s)
  DateTime.xmlschema(s)

  true
rescue ArgumentError => e
  if e.message == 'invalid date'
    false
  else
    raise e
  end
end