diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-27 09:27:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-27 09:27:47 +0000 |
commit | d0fa578cdcb041ec3e42d8bcba0bfcf9984def6d (patch) | |
tree | a59362bd849e66a7b5556245b8a42fd2c6cfb110 /array.c | |
parent | 9473f86fb0ca396adaccf151874604faf47d852e (diff) |
array.c: rb_check_to_array
* array.c (rb_check_to_array): conversion to array by to_a method.
returns nil if not possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r-- | array.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -655,6 +655,12 @@ rb_check_array_type(VALUE ary) return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_ary); } +VALUE +rb_check_to_array(VALUE ary) +{ + return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a); +} + /* * call-seq: * Array.try_convert(obj) -> array or nil |