Class: UnboundMethod
Instance Method Summary collapse
-
#body ⇒ Object
The node that acts as body of the method.
- #unchecked_bind(recv) ⇒ Object
Instance Method Details
#body ⇒ Object
The node that acts as body of the method
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'ext/rallhook_base/method_node.c', line 90
VALUE rb_method_body(VALUE self) {
// VALUE name = rb_funcall(self, intern_name, 0);
// VALUE sym = rb_funcall(name, intern_sym, 0);
// VALUE owner = rb_funcall(self, intern_owner, 0);
// NODE* body = rb_method_node(owner, SYM2ID(sym) );
struct METHOD* method;
Data_Get_Struct(self,struct METHOD,method);
if (method->body == 0) return Qnil;
#ifdef RUBY1_8
// nd_defn is only present in ruby_1.8
if (method->body->nd_defn != 0) {
return Data_Wrap_Struct(rb_cNode, 0, 0, method->body->nd_defn);
}
#endif
return Data_Wrap_Struct(rb_cNode, 0, 0, method->body);
}
|
#unchecked_bind(recv) ⇒ Object
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'ext/rallhook_base/method_node.c', line 177
static VALUE
umethod_unchecked_bind(VALUE method, VALUE recv)
{
struct METHOD *data, *bound;
Data_Get_Struct(method, struct METHOD, data);
method = Data_Make_Struct(rb_cMethod, struct METHOD, bm_mark, -1, bound);
*bound = *data;
bound->recv = recv;
#ifdef RUBY1_8
bound->rklass = CLASS_OF(recv);
#endif
#ifdef RUBY1_9
bound->rclass = CLASS_OF(recv);
#endif
return method;
}
|