るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.027秒)

別のキーワード

  1. _builtin nil?
  2. object nil?
  3. nilclass nil?
  4. object nil
  5. _builtin nil

クラス

モジュール

検索結果

Kernel$$! -> Exception | nil (54961.0)

最後に例外が発生したときの Exception オブジェクトです。 該当する例外がないときは nil です。

最後に例外が発生したときの Exception オブジェクトです。
該当する例外がないときは nil です。

Kernel.#raise によって設定されます。

この変数はスレッドローカル、読み取り専用です。

Exception#cause -> Exception | nil (9676.0)

self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、 その前に発生していた元々の例外)を返します。存在しない場合は nil を返し ます。

self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、
その前に発生していた元々の例外)を返します。存在しない場合は nil を返し
ます。

//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
p $! # => #<RuntimeError: outer>
p $!.cause # => #<RuntimeError: inner>
end
//}