source_location()
public
Returns the Ruby source filename and
line number containing this method or nil if this method was not defined in
Ruby (i.e. native)
VALUE
rb_method_location(VALUE method)
{
rb_method_definition_t *def = method_get_def(method);
if (def->type == VM_METHOD_TYPE_ATTRSET || def->type == VM_METHOD_TYPE_IVAR) {
if (!def->body.attr.location)
return Qnil;
return rb_ary_dup(def->body.attr.location);
}
return iseq_location(method_get_iseq(def));
}