aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/object.c b/object.c
index d41f3570fd..436469ab40 100644
--- a/object.c
+++ b/object.c
@@ -2094,6 +2094,18 @@ rb_to_integer(val, method)
}
VALUE
+rb_check_to_integer(val, method)
+ VALUE val;
+ char *method;
+{
+ VALUE v = convert_type(val, "Integer", method, Qfalse);
+ if (!rb_obj_is_kind_of(v, rb_cInteger)) {
+ return Qnil;
+ }
+ return v;
+}
+
+VALUE
rb_to_int(val)
VALUE val;
{