Class: Swift::DateTime

Inherits:
DateTime
  • Object
show all
Defined in:
ext/swift/db/sqlite3/datetime.c

Class Method Summary collapse

Class Method Details

.parse(string) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
# File 'ext/swift/db/sqlite3/datetime.c', line 78

VALUE rb_datetime_parse(VALUE self, VALUE string) {
  VALUE datetime;
  const char *data = CSTRING(string);
  size_t size = TYPE(string) == T_STRING ? (size_t)RSTRING_LEN(string) : strlen(data);

  if (NIL_P(string))
    return Qnil;

  datetime = datetime_parse(self, data, size);
  return NIL_P(datetime) ? rb_call_super(1, &string) : datetime;
}