Class: UnboundMethod

Inherits:
Object show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#force_bind(object) ⇒ Method

Returns a Method object bound to the given object. Doesn’t check that the method is compatible with the object, unlike bind.

Returns:

  • (Method)


828
829
830
831
832
833
834
835
836
837
838
# File 'ext/evilr/evilr.c', line 828

static VALUE evilr_force_bind(VALUE self, VALUE obj) {
  struct METHOD *data;

  evilr__check_immediate(obj);
  self = rb_funcall(self, evilr__clone, 0);
  /* Data_Get_Struct seems to complain about types on 1.9,
   * so skip the type check. */
  data = (struct METHOD*)DATA_PTR(self);
  data->rclass = CLASS_OF(obj);
  return rb_funcall(self, evilr__bind, 1, obj);
}