クラス
- Array (170)
- BasicObject (36)
- Binding (7)
- Complex (48)
- Data (6)
-
Encoding
:: Converter (192) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) -
Enumerator
:: Lazy (24) - Exception (128)
- Fiber (6)
- File (12)
- Float (36)
- IO (120)
- Integer (36)
- MatchData (4)
- Method (24)
- Module (207)
- Mutex (2)
- NilClass (36)
- Numeric (24)
- Object (120)
- Proc (12)
- Rational (309)
- Regexp (12)
-
RubyVM
:: InstructionSequence (130) - Set (12)
- SignalException (24)
- String (192)
- Struct (24)
- Thread (70)
-
Thread
:: Backtrace :: Location (84) -
Thread
:: ConditionVariable (20) -
Thread
:: Mutex (10) -
Thread
:: Queue (30) -
Thread
:: SizedQueue (30) - Time (86)
- TracePoint (19)
- UnboundMethod (24)
モジュール
- Enumerable (200)
キーワード
- * (12)
- ** (12)
- + (12)
- - (12)
- -@ (9)
-
/ (12) - <=> (12)
- == (24)
- === (12)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) - abs (9)
-
absolute
_ path (24) - autoload (12)
- autoload? (12)
- backtrace (12)
-
backtrace
_ locations (36) -
base
_ label (24) - broadcast (10)
- byteindex (3)
- capitalize (9)
- capitalize! (9)
- cause (12)
- ceil (12)
- clone (39)
- coerce (12)
-
collect
_ concat (36) - combination (24)
- concat (42)
- conjugate (24)
-
const
_ added (3) -
const
_ defined? (12) -
const
_ get (12) -
const
_ missing (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- convert (12)
- convpath (12)
- deconstruct (11)
-
deconstruct
_ keys (13) -
define
_ singleton _ method (24) - denominator (12)
-
deprecate
_ constant (12) - deq (20)
-
destination
_ encoding (12) - detect (24)
- disasm (12)
- disassemble (12)
- downcase (9)
- downcase! (9)
- dup (15)
- each (60)
-
each
_ cons (24) -
each
_ line (60) - encode (36)
- encode! (24)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
- exception (24)
- fdiv (12)
- fetch (12)
- find (24)
- finish (12)
-
first
_ lineno (12) -
flat
_ map (36) - flock (12)
- floor (12)
-
ignore
_ deadlock= (4) -
incomplete
_ input? (12) -
insert
_ output (12) - inspect (48)
-
instruction
_ sequence (7) - intersection (9)
- label (24)
-
last
_ error (12) - lineno (12)
- magnitude (9)
-
module
_ function (36) - mon (12)
- monday? (12)
- month (12)
- negative? (9)
- none? (15)
- numerator (12)
- one? (45)
- partition (36)
- path (24)
- permutation (24)
- pop (20)
- positive? (9)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) -
private
_ constant (12) -
public
_ constant (12) - putback (24)
- quo (24)
- raise (6)
-
raised
_ exception (12) - rationalize (108)
-
remove
_ const (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - replacement (12)
- replacement= (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - round (12)
- rpartition (12)
-
ruby2
_ keywords (12) -
set
_ backtrace (12) - shift (20)
- signal (10)
- signm (12)
- signo (12)
-
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
slice
_ before (24) -
source
_ encoding (12) -
source
_ location (43) - strftime (12)
- subsec (12)
- swapcase (9)
- swapcase! (9)
- synchronize (12)
-
to
_ a (18) -
to
_ binary (10) -
to
_ f (12) -
to
_ i (12) -
to
_ r (84) -
to
_ s (36) - truncate (12)
- union (10)
- upcase (9)
- upcase! (9)
- values (6)
- zone (12)
検索結果
先頭5件
-
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (18409.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ption#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Dat......month, -1).day == 31
raise "#{month} is not long month"
end
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_e......xception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Exception
# exception(error _ message) -> Exception (18409.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
#......... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Rational
# rationalize(eps = 0) -> Rational (18409.0) -
自身から eps で指定した許容誤差の範囲に収まるような Rational を返 します。
...な Rational を返
します。
eps を省略した場合は self を返します。
@param eps 許容する誤差
//emlist[例][ruby]{
r = Rational(5033165, 16777216)
r.rationalize # => (5033165/16777216)
r.rationalize(Rational(0.01)) # => (3/10)
r.rationalize(Rational(0.1))... -
Thread
# report _ on _ exception -> bool (18347.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...$stderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thr......ad.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thre......ad:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# report _ on _ exception=(newstate) (18347.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...$stderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thr......ad.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Thread:0x00007fc3f48c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thre......ad:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run # => #<Thread:0x00007fc3f48aefc0@(irb):4 dead>
//}
@see Thread.report_on_exception... -
Thread
# abort _ on _ exception -> bool (18329.0) -
真の場合、そのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例 外は、Thread#join などで検出されない限りそのスレッ ドだけをなにも警告を出さずに終了させます。
...スレッドで起こった例
外は、Thread#join などで検出されない限りそのスレッ
ドだけをなにも警告を出さずに終了させます。
デフォルトは偽です。c:Thread#exceptionを参照してください。
@param newstate 自身を実行中に例外発生し......た場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.abort_on_exception # => false
thread.abort_on_exception = true
thread.abort_on_exception # => true
//}... -
Thread
# abort _ on _ exception=(newstate) (18329.0) -
真の場合、そのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例 外は、Thread#join などで検出されない限りそのスレッ ドだけをなにも警告を出さずに終了させます。
...スレッドで起こった例
外は、Thread#join などで検出されない限りそのスレッ
ドだけをなにも警告を出さずに終了させます。
デフォルトは偽です。c:Thread#exceptionを参照してください。
@param newstate 自身を実行中に例外発生し......た場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.abort_on_exception # => false
thread.abort_on_exception = true
thread.abort_on_exception # => true
//}... -
Encoding
:: Converter # destination _ encoding -> Encoding (18309.0) -
変換先のエンコーディングを返します。
...変換先のエンコーディングを返します。
@return 変換先のエンコーディング
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "euc-jp")
ec.destination_encoding #=> #<Encoding:EUC-JP>
//}... -
Enumerable
# partition -> Enumerator (18309.0) -
各要素を、ブロックの条件を満たす要素と満たさない要素に分割します。 各要素に対してブロックを評価して、その値が真であった要素の配列と、 偽であった要素の配列の 2 つを配列に入れて返します。
...要素の配列と、
偽であった要素の配列の 2 つを配列に入れて返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0].partition {|i| i % 3 == 0 }
#=> [[9, 6, 3, 0], [10, 8, 7, 5, 4, 2, 1]]
//}...