/*
* call-seq:
* method.body => Node
*
* Given a Method, returns the Node for that Method's body. This can be
* used to directly copy one class's method to another (using
* add_method).
*/
static VALUE method_body(VALUE method)
{
struct METHOD * m;
if(ruby_safe_level >= 4)
{
/* no access to potentially sensitive data from the sandbox */
rb_raise(rb_eSecurityError, "Insecure: can't get method body");
}
Data_Get_Struct(method, struct METHOD, m);
return wrap_node(m->body);
}