1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Define rb_to_array which converts with to_a

This commit is contained in:
Nobuyoshi Nakada 2021-02-12 11:47:04 +09:00
parent 1a3b68e7c1
commit e8b210542b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 7 additions and 0 deletions

View file

@ -996,6 +996,12 @@ rb_check_to_array(VALUE ary)
return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a);
}
VALUE
rb_to_array(VALUE ary)
{
return rb_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a);
}
/*
* call-seq:
* Array.try_convert(object) -> object, new_array, or nil

View file

@ -29,6 +29,7 @@ VALUE rb_ary_tmp_new_fill(long capa);
VALUE rb_ary_at(VALUE, VALUE);
size_t rb_ary_memsize(VALUE);
VALUE rb_to_array_type(VALUE obj);
VALUE rb_to_array(VALUE obj);
void rb_ary_cancel_sharing(VALUE ary);
static inline VALUE rb_ary_entry_internal(VALUE ary, long offset);