Class: UnboundMethod

Inherits:
Object
  • Object
show all
Defined in:
ext/force_bind.c

Instance Method Summary collapse

Instance Method Details

#force_bind(recv) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'ext/force_bind.c', line 45

VALUE
umethod_force_bind(VALUE method, VALUE recv)
{
  struct METHOD *data, *bound;

  Data_Get_Struct(method, struct METHOD, data);
  method = Data_Make_Struct(rb_cMethod, struct METHOD, free, -1, bound);
  *bound = *data;
  bound->recv = recv;
  bound->rclass = TYPE(recv) == T_CLASS ? RCLASS(recv) : CLASS_OF(recv);

  return method;
}