Class | DBI::Type::Timestamp |
In: |
lib/dbi/types.rb
|
Parent: | Null |
# File lib/dbi/types.rb, line 105 105: def self.parse(obj) 106: obj = super 107: return obj unless obj 108: case obj.class 109: when ::DateTime 110: return obj 111: when ::Date 112: return ::DateTime.parse(obj.to_s) 113: when ::Time 114: return ::DateTime.parse(obj.to_s) 115: else 116: return ::DateTime.parse(obj.to_s) if obj.respond_to? :to_s 117: return ::DateTime.parse(obj.to_str) if obj.respond_to? :to_str 118: return obj 119: end 120: end