diff options
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2200,6 +2200,19 @@ rb_to_integer(val, method) } VALUE +rb_check_to_integer(VALUE val, const char *method) +{ + VALUE v; + + if (FIXNUM_P(val)) return val; + 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; { |