summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-27 09:27:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-27 09:27:47 +0000
commitd0fa578cdcb041ec3e42d8bcba0bfcf9984def6d (patch)
treea59362bd849e66a7b5556245b8a42fd2c6cfb110 /array.c
parent9473f86fb0ca396adaccf151874604faf47d852e (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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/array.c b/array.c
index 5cb86f2532..a2438a3206 100644
--- a/array.c
+++ b/array.c
@@ -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