Ruby 2.0.0 リファレンスマニュアル > ライブラリ一覧 > readlineライブラリ > Readline::HISTORYオブジェクト > push
push(*string) -> self[permalink][rdoc]ヒストリの最後に string で指定した文字列を追加します。複数の string を指定できます。 self を返します。
例: "foo"を追加する。
require "readline"
Readline::HISTORY.push("foo")
p Readline::HISTORY[-1] #=> "foo"
例: "foo"、"bar"を追加する。
require "readline"
Readline::HISTORY.push("foo", "bar")
p Readline::HISTORY[-1] #=> "bar"
p Readline::HISTORY[-2] #=> "foo"
[SEE_ALSO] Readline::HISTORY.<<