Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (VALUE)toRuby {
- switch ([self objCType]) {
- case @encode(char):
- case @encode(unsigned char): return CHR2FIX([self charValue]); break;
- case @encode(short):
- case @encode(long):
- case @encode(int): return INT2FIX([self intValue]); break;
- case @encode(unsigned short):
- case @encode(unsigned long):
- case @encode(unsigned int): return UINT2NUM([self unsignedIntValue]); break;
- case @encode(unsigned float):
- case @encode(float): return rb_float_new([self floatValue]); break;
- case @encode(unsigned double):
- case @encode(double): return rb_float_new([self doubleValue]); break;
- }
- }
Add Comment
Please, Sign In to add comment