summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index a06a0a915f..8545e6c881 100644
--- a/iseq.c
+++ b/iseq.c
@@ -959,6 +959,20 @@ rb_iseq_klass(VALUE self)
return iseq->local_iseq->klass;
}
+VALUE
+rb_iseq_method_name(VALUE self)
+{
+ rb_iseq_t *iseq, *local_iseq;
+ GetISeqPtr(self, iseq);
+ local_iseq = iseq->local_iseq;
+ if (local_iseq->type == ISEQ_TYPE_METHOD) {
+ return local_iseq->location.base_label;
+ }
+ else {
+ return Qnil;
+ }
+}
+
static
VALUE iseq_data_to_ary(rb_iseq_t *iseq);