This commit is contained in:
BurdetteLamar 2024-08-02 20:17:47 +01:00 коммит произвёл Peter Zhu
Родитель a793b5376c
Коммит 3471437630
1 изменённых файлов: 5 добавлений и 8 удалений

13
array.c
Просмотреть файл

@ -1346,18 +1346,15 @@ ary_take_first_or_last(int argc, const VALUE *argv, VALUE ary, enum ary_take_pos
/*
* call-seq:
* array << object -> self
* self << object -> self
*
* Appends +object+ to +self+; returns +self+:
* Appends +object+ as the last element in +self+; returns +self+:
*
* a = [:foo, 'bar', 2]
* a << :baz # => [:foo, "bar", 2, :baz]
* [:foo, 'bar', 2] << :baz # => [:foo, "bar", 2, :baz]
*
* Appends +object+ as one element, even if it is another +Array+:
* Appends +object+ as a single element, even if it is another array:
*
* a = [:foo, 'bar', 2]
* a1 = a << [3, 4]
* a1 # => [:foo, "bar", 2, [3, 4]]
* [:foo, 'bar', 2] << [3, 4] # => [:foo, "bar", 2, [3, 4]]
*
*/