Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Arrayクラス > replace

instance method Array#replace

replace(another) -> self

配列の内容を配列 another の内容で置き換えます。

[PARAM] another:
配列を指定します。
a = [1, 2, 3]
a.replace [4, 5, 6]
p a                 #=> [4, 5, 6]
class Array