479件ヒット
[201-300件を表示]
(0.230秒)
種類
- インスタンスメソッド (266)
- 特異メソッド (130)
- モジュール関数 (47)
- クラス (24)
- 変数 (12)
ライブラリ
- ビルトイン (479)
クラス
-
ARGF
. class (10) -
Encoding
:: Converter (12) - Exception (160)
- Fiber (6)
- Hash (8)
- IO (36)
- SignalException (60)
- Thread (84)
- TracePoint (12)
モジュール
- Kernel (59)
オブジェクト
- ENV (8)
キーワード
-
$ ! (12) - == (12)
- Complex (14)
- Exception (12)
- Float (7)
- Integer (7)
- Rational (7)
- SignalException (12)
-
abort
_ on _ exception (24) -
abort
_ on _ exception= (24) - backtrace (12)
-
backtrace
_ locations (12) - cause (12)
- exception (36)
- inspect (12)
-
last
_ error (12) - new (48)
- raise (6)
-
raised
_ exception (12) -
read
_ nonblock (22) -
report
_ on _ exception (18) -
report
_ on _ exception= (18) - select (24)
-
set
_ backtrace (12) - signm (12)
- signo (12)
- slice (8)
-
to
_ s (12) -
to
_ tty? (8) -
write
_ nonblock (12)
検索結果
先頭5件
-
SignalException
. new(sig _ number) -> SignalException (11100.0) -
引数で指定したシグナルに関する SignalException オブジェクトを生成して返 します。
...引数で指定したシグナルに関する SignalException オブジェクトを生成して返
します。
引数は Signal.#list に含まれるもののいずれかを指定する必要があり
ます。
@param sig_name シグナル名を Symbol オブジェクト、文字列のいずれ......ます。
//emlist[例][ruby]{
signal_number = Signal.list["INT"]
se = SignalException.new(signal_number) # => #<SignalException: SIGINT>
se.signo # => 2
//}
//emlist[例][ruby]{
se = SignalException.new("INT") # => #<SignalException: SIGINT>
se.signm # => "SIGINT"
//}
@see Signal.#list... -
SignalException
. new(sig _ number , sig _ name) -> SignalException (11100.0) -
引数で指定したシグナルに関する SignalException オブジェクトを生成して返 します。
...引数で指定したシグナルに関する SignalException オブジェクトを生成して返
します。
引数は Signal.#list に含まれるもののいずれかを指定する必要があり
ます。
@param sig_name シグナル名を Symbol オブジェクト、文字列のいずれ......ます。
//emlist[例][ruby]{
signal_number = Signal.list["INT"]
se = SignalException.new(signal_number) # => #<SignalException: SIGINT>
se.signo # => 2
//}
//emlist[例][ruby]{
se = SignalException.new("INT") # => #<SignalException: SIGINT>
se.signm # => "SIGINT"
//}
@see Signal.#list... -
Exception
# ==(other) -> bool (11000.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...トを指定した場合は
Exception#exception を実行して変換を試みます。
//emlist[例][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield......rescue => e
e
end
end
results = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]
# class, mess... -
Exception
# backtrace -> [String] (11000.0) -
バックトレース情報を返します。
...)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)
という形式の String の配列です。
//emlist[例][ruby]{
def methd
raise
end
begin
methd
rescue => e
p e.backtrace
end
#=> ["filename.rb:2:in `methd'", "filename.rb:6"]
//}
@see Exception#backtrace_locations... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (11000.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...バックトレース情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require......def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backt... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (11000.0) -
例外の整形された文字列を返します。
...値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で指定する必要があります。
バックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tt......e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}
@see Exception.to_tty?... -
Exception
# inspect -> String (11000.0) -
self のクラス名と message を文字列にして返します。
...self のクラス名と message を文字列にして返します。
//emlist[例][ruby]{
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end
//}... -
Exception
# message -> String (11000.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (11000.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.se...