Class: Method
Instance Method Summary collapse
-
#body ⇒ Object
The node that acts as body of the method.
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);
}
|