ライブラリ
- ビルトイン (3)
検索結果
-
Kernel
. # at _ exit { . . . } -> Proc (18156) -
与えられたブロックをインタプリタ終了時に実行します。
...与えられたブロックをインタプリタ終了時に実行します。
at_exitがメソッドである点を除けば、END ブロックによる終了
処理の登録と同等です。登録した処理を取り消すことはできません。
spec/terminateも参照してください。......turn 登録した処理を Proc オブジェクトで返します。
3.times do |i|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"
#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
@see d:spec/control#END...
