APIdock / Ruby
/
method

unbind

ruby latest stable - Class: Method
unbind()
public

Dissociates meth from its current receiver. The resulting UnboundMethod can subsequently be bound to a new object of the same class (see UnboundMethod).

static VALUE
method_unbind(VALUE obj)
{
 VALUE method;
 struct METHOD *orig, *data;
 TypedData_Get_Struct(obj, struct METHOD, &method_data_type, orig);
 method = TypedData_Make_Struct(rb_cUnboundMethod, struct METHOD,
 &method_data_type, data);
 RB_OBJ_WRITE(method, &data->recv, Qundef);
 RB_OBJ_WRITE(method, &data->klass, orig->klass);
 RB_OBJ_WRITE(method, &data->me, rb_method_entry_clone(orig->me));
 OBJ_INFECT(method, obj);
 return method;
}

AltStyle によって変換されたページ (->オリジナル) /