[ruby] add support for T_DATA objects

Since certain types of objects, like Time, are T_DATA and not T_OBJECT, need to add support for them in order to be able to use FREEZE/THAW.