Class: Dynamoid::TypeCasting::DateTypeCaster

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamoid/type_casting.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dynamoid::TypeCasting::Base

Instance Method Details

#process(value) ⇒ Object


257
258
259
260
261
262
263
264
265
266
267
# File 'lib/dynamoid/type_casting.rb', line 257

def process(value)
  if !value.respond_to?(:to_date)
    nil
  else
    begin
      value.to_date
    rescue StandardError
      nil
    end
  end
end