Ruby 3.4 リファレンスマニュアル

instance method Array#to_ary

to_ary -> self[permalink][rdoc][edit]

self をそのまま返します。

class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])

p ary1.to_ary      # => [1, 2, 3, 4]
p ary1.to_ary.class  # => Array

p ary2.to_ary      # => [1, 2, 3, 4]
p ary2.to_ary.class  # => SubArray

[SEE_ALSO] Array#to_a