クラス
- Array (22)
-
Encoding
:: Converter (44) -
Enumerator
:: ArithmeticSequence (12) -
Enumerator
:: Lazy (44) - Exception (7)
- Hash (5)
- Object (11)
- Range (119)
- Regexp (55)
-
RubyVM
:: AbstractSyntaxTree :: Node (12) - String (198)
- Thread (32)
モジュール
- Enumerable (66)
- Kernel (182)
- Process (7)
キーワード
-
$ & (11) -
$ & # 39; (11) -
$ 1 (11) -
$ 10 (11) -
$ 11 (11) -
$ 2 (11) -
$ 3 (11) -
$ 4 (11) -
$ 5 (11) -
$ 6 (11) -
$ 7 (11) -
$ 8 (11) -
$ 9 (11) -
$ ? (7) -
$ ` (11) -
$ ~ (11) - =~ (11)
- Regexp (11)
-
SCRIPT
_ LINES _ _ (11) - [] (66)
- abort (10)
- begin (11)
-
chunk
_ while (11) - compile (11)
- end (11)
- first (33)
-
last
_ column (6) -
last
_ error (11) -
last
_ lineno (6) -
last
_ match (22) -
last
_ status (7) - max (42)
- new (55)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) -
ruby2
_ keywords _ hash? (5) - slice (66)
- slice! (66)
-
slice
_ after (22) -
slice
_ before (22) -
slice
_ when (11) -
take
_ while (22) - zip (22)
検索結果
先頭5件
-
Enumerator
:: ArithmeticSequence # last -> Numeric | nil (32204.0) -
等差数列の最後の要素、もしくは最後の n 要素を返します。
等差数列の最後の要素、もしくは最後の n 要素を返します。
@param n 取得する要素数。 -
Enumerator
:: ArithmeticSequence # last(n) -> [Numeric] (32204.0) -
等差数列の最後の要素、もしくは最後の n 要素を返します。
等差数列の最後の要素、もしくは最後の n 要素を返します。
@param n 取得する要素数。 -
Array
# last -> object | nil (26221.0) -
配列の末尾の要素を返します。配列が空のときは nil を返します。
...配列の末尾の要素を返します。配列が空のときは nil を返します。
//emlist[例][ruby]{
p [0, 1, 2].last #=> 2
p [].last #=> nil
//}
@see Array#first... -
Range
# last -> object (26218.0) -
終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま せん。
...終端の要素を返します。範囲オブジェクトが終端を含むかどうかは関係ありま
せん。
//emlist[例][ruby]{
(10..20).last # => 20
(10...20).last # => 20
//}
@see Range#begin... -
Range
# last(n) -> [object] (26218.0) -
最後の n 要素を返します。範囲内に要素が含まれない場合は空の配列を返します。
...nt メソッドによる暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError n に負の数を指定した場合に発生します。
[......引数を省略して実行した場合は、終端を含むかどうか
(Range#exclude_end? の戻り値)に関わらず終端の要素を返す事に注意し
てください。
//emlist[例][ruby]{
(10..20).last(3) # => [18, 19, 20]
(10...20).last(3) # => [17, 18, 19]
//}
@see Range#first... -
Encoding
:: Converter # last _ error -> Exception | nil (20215.0) -
直前に変換器で発生した例外に相当する例外オブジェクトを返します。 直前の変換で例外が発生していない場合は nil を返します。
...します。
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
p ec.primitive_convert(src="\xf1abcd", dst="") #=> :invalid_byte_sequence
p ec.last_error #=> #<Encoding::InvalidByteSequenceError: "\xF1" followed by "a" on UTF-8>
p ec.primitive_convert(src, dst, nil, 1)......#=> :destination_buffer_full
p ec.last_error #=> nil
//}... -
RubyVM
:: AbstractSyntaxTree :: Node # last _ lineno -> Integer (20209.0) -
ソースコード中で、self を表すテキストが最後に現れる行番号を返します。
...ソースコード中で、self を表すテキストが最後に現れる行番号を返します。
行番号は1-originです。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_lineno # => 1
//}... -
Process
. last _ status -> Process :: Status | nil (17221.0) -
カレントスレッドで最後に終了した子プロセスのステータスを返します。
...。
Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status # => #<Process::Status: pid 4825 exit 13>
カレントスレッドで子プロセスを実行したことがない場合は nil を返します。
Process.last_status # => nil
@see Process::Status
@see $?... -
Thread
. report _ on _ exception -> bool (17220.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を $stderr に報告します。
デフォルトは false です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block......in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が......で rescue して、
その例外でスレッドが終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレ......容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `blo......ck in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が... -
Thread
. report _ on _ exception=(newstate) (17220.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を $stderr に報告します。
デフォルトは false です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block......in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が......で rescue して、
その例外でスレッドが終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレ......容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `blo......ck in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が... -
RubyVM
:: AbstractSyntaxTree :: Node # last _ column -> Integer (17209.0) -
ソースコード中で、self を表すテキストが最後に現れる列番号を返します。
...ソースコード中で、self を表すテキストが最後に現れる列番号を返します。
列番号は0-originで、バイト単位で表されます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_column # => 5
//}... -
Thread
# report _ on _ exception -> bool (17208.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...tderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Threa......p; 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
# #<Thread:0x0......0007fc3f48c7908@(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) (17208.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...tderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Threa......p; 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
# #<Thread:0x0......0007fc3f48c7908@(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...