summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'class.c')
-rw-r--r--class.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/class.c b/class.c
index 865197b843..0f4394d97d 100644
--- a/class.c
+++ b/class.c
@@ -1257,6 +1257,16 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
rb_attr(klass, rb_intern(name), read, write, FALSE);
}
+int
+rb_obj_basic_to_s_p(obj)
+{
+ const rb_method_entry_t *me = rb_method_entry(CLASS_OF(obj), rb_intern("to_s"));
+ if (me && me->def && me->def->type == VM_METHOD_TYPE_CFUNC &&
+ me->def->body.cfunc.func == rb_any_to_s)
+ return 1;
+ return 0;
+}
+
#include <stdarg.h>
int