Method: DateTime#clone

Defined in:
ext/date_ext/datetime.c

#cloneDateTime

Returns a clone of the receiver.

Returns:



1070
1071
1072
1073
1074
1075
1076
1077
# File 'ext/date_ext/datetime.c', line 1070

static VALUE rhrdt_clone(VALUE self) {
  rhrdt_t *d, *nd;
  VALUE rd = rb_call_super(0, NULL);
  Data_Get_Struct(self, rhrdt_t, d);
  Data_Get_Struct(rd, rhrdt_t, nd);
  memcpy(nd, d, sizeof(rhrdt_t));
  return rd;
}