diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-05 01:05:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-05 01:05:03 +0000 |
commit | a6eded88af6390cccf009bc3da4eb44ab71a42fd (patch) | |
tree | 5af321a3e35840a89ac58043a7c4ba9746c52cb6 /object.c | |
parent | 5e50b5099f33b61f070ec010b040ee14334113c6 (diff) | |
download | ruby-a6eded88af6390cccf009bc3da4eb44ab71a42fd.tar.gz |
* object.c (rb_check_to_integer): backported for range_step.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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; { |