Exemplo n.º 1
0
/*
 * call-seq:
 *   marshal_dump -> Array
 *
 * Provides marshalling support for use by the Marshal library.
 * ===Return value
 * Array
 */
DLL_LOCAL VALUE _marshal_dump(VALUE self)
{
    VALUE ptr[2];
    ptr[0] = _getWidth(self);
    ptr[1] = _getHeight(self);
    return rb_ary_new4(2, ptr);
}
Exemplo n.º 2
0
/*
 * call-seq:
 *   inspect -> String
 *
 * Human-readable description.
 * ===Return value
 * String
*/
DLL_LOCAL VALUE _inspect(VALUE self)
{
	return rb_sprintf( "%s(%d, %d)",
		rb_obj_classname( self ),
		RB_NUM2INT(_getWidth(self)),
		RB_NUM2INT(_getHeight(self)));
}
Exemplo n.º 3
0
/*
 * call-seq:
 *   inspect -> String
 *
 * Human-readable description.
 * ===Return value
 * String
*/
VALUE _inspect(VALUE self)
{
	VALUE array[6];
	array[0]=rb_str_new2("#<%s:(%d, %d, %d, %d)>");
	array[1]=rb_class_of(self);
	array[2]=_getX(self);
	array[3]=_getY(self);
	array[4]=_getWidth(self);
	array[5]=_getHeight(self);
	return rb_f_sprintf(6,array);
}