ライブラリ
- ビルトイン (1125)
- json (12)
-
json
/ add / exception (12) -
net
/ http (60) - openssl (12)
- optparse (24)
-
rubygems
/ command (12) - shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (18) - socket (48)
- strscan (84)
- thread (12)
- win32ole (24)
- zlib (252)
クラス
- Array (84)
- BasicSocket (12)
-
Encoding
:: Converter (48) -
Encoding
:: InvalidByteSequenceError (24) -
Encoding
:: UndefinedConversionError (12) - Enumerator (12)
-
Enumerator
:: ArithmeticSequence (28) - Exception (140)
-
File
:: Stat (12) - FrozenError (6)
-
Gem
:: Command (12) - IO (12)
- Integer (23)
-
JSON
:: State (12) - KeyError (16)
- LoadError (12)
- LocalJumpError (24)
- MatchData (48)
- Module (12)
- Mutex (2)
- NameError (44)
-
Net
:: HTTPResponse (12) - NoMethodError (12)
- Object (12)
-
OpenSSL
:: SSL :: SSLContext (12) - OptionParser (24)
- Random (36)
- Range (91)
- Regexp (24)
- Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (18) - SignalException (24)
- Socket (12)
- StopIteration (12)
- String (144)
- StringScanner (84)
- SystemCallError (12)
- SystemExit (24)
- Thread (60)
-
Thread
:: Mutex (10) -
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - TracePoint (12)
- UDPSocket (12)
- UNIXServer (12)
- UncaughtThrowError (33)
- WIN32OLE (24)
-
Zlib
:: GzipReader (216) -
Zlib
:: GzipWriter (24) -
Zlib
:: Inflate (12)
モジュール
- Comparable (12)
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (36)
キーワード
-
/ (11) - == (19)
- =~ (12)
- [] (138)
- accept (12)
-
accept
_ nonblock (12) - args (12)
- at (12)
- backtrace (12)
-
backtrace
_ locations (12) -
beginning
_ of _ line? (12) - begins? (12)
- bol? (12)
-
ca
_ file= (12) - cause (12)
-
check
_ circular? (12) - clamp (12)
- close (12)
-
connect
_ nonblock (12) - cover? (19)
- deq (24)
- div (12)
- each (24)
-
each
_ byte (24) -
each
_ line (24) - end (31)
- eof (12)
- eof? (12)
- errno (12)
-
error
_ bytes (12) -
error
_ char (12) - exception (24)
- exit (12)
-
exit
_ value (12) - fetch (72)
- finish (12)
- first (24)
-
fixed
_ encoding? (12) - getc (12)
- getpeereid (12)
- gets (12)
- hash (7)
-
incomplete
_ input? (12) -
initialize
_ copy (12) - inspect (12)
- key (8)
- kill (12)
- last (24)
- lineno (12)
- lineno= (12)
-
local
_ variables (10) - mkdir (18)
- name (12)
- next (12)
- offset (24)
-
ole
_ get _ methods (12) -
ole
_ query _ interface (12) - path (12)
- peek (12)
- peep (12)
- pointer= (12)
- pop (24)
- pos= (12)
-
primitive
_ convert (48) -
public
_ constant (12) - raise (12)
-
raised
_ exception (12) - rand (36)
- read (12)
- readbyte (12)
- readchar (12)
- readline (12)
- readlines (12)
- reason (12)
- receiver (24)
-
recvfrom
_ nonblock (12) - reject (12)
- response (12)
- result (12)
- rewind (12)
-
set
_ backtrace (12) -
set
_ dictionary (12) - shift (24)
- signm (12)
- signo (12)
- slice (72)
- status (12)
- sticky? (12)
- success? (12)
- tag (11)
- terminate (12)
- test (18)
-
to
_ json (12) -
to
_ s (35) - ungetc (12)
- unlock (12)
- unscan (12)
- value (23)
検索結果
先頭5件
-
Array
# [](range) -> Array | nil (61.0) -
Range オブジェクト range の範囲にある要素からなる部分配列を返します。 range の begin が自身の範囲外となる時は nil を返します。ただし、begin が配列の長さに等しいときは空の配列を返します。 range の begin が end より後にある場合には空の配列を返します。
...ある要素からなる部分配列を返します。
range の begin が自身の範囲外となる時は nil を返します。ただし、begin が配列の長さに等しいときは空の配列を返します。
range の begin が end より後にある場合には空の配列を返します......。
@param range 生成したい部分配列の範囲を Range オブジェクトで指定します。
range の begin や end の値が負の時には末尾からのインデックスと見倣します。末尾
の要素が -1 番目になります。
end の......から -2 番目、end は先頭から (4+1) 番目となる。)
a[0..10] #=> ["a", "b", "c", "d", "e"]
a[10..11] #=> nil
a[2..1] #=> []
a[-1..-2] #=> []
# 特殊なケース。begin が自身の長さと同じ場合には以下のようになります。
a[5] #=> nil
a[5..10] #=> []
//}... -
Random
# rand -> Float (37.0) -
一様な擬似乱数を発生させます。
...範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
この......ge 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのよ... -
Random
# rand(max) -> Integer | Float (37.0) -
一様な擬似乱数を発生させます。
...範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
この......ge 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのよ... -
Random
# rand(range) -> Integer | Float (37.0) -
一様な擬似乱数を発生させます。
...範囲から除かれます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
この......ge 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値である必要があり、
range.begin + 数値 が適切な値を返す必要があります。
@raise Errno::EDOM rand(1..Float::INFINITY) などのよ... -
Comparable
# clamp(min , max) -> object (25.0) -
self を範囲内に収めます。
...ようになります。
self <=> range.begin が負数を返したときは range.begin を、
self <=> range.end が正数を返したときは range.end を、
それ以外の場合は self を返します。
range.begin が nil の場合、range.begin は self よりも小さい値として扱... -
Comparable
# clamp(range) -> object (25.0) -
self を範囲内に収めます。
...ようになります。
self <=> range.begin が負数を返したときは range.begin を、
self <=> range.end が正数を返したときは range.end を、
それ以外の場合は self を返します。
range.begin が nil の場合、range.begin は self よりも小さい値として扱... -
StringScanner
# unscan -> self (19.0) -
スキャンポインタを前回のマッチの前の位置に戻します。
...Scanner.new('test string')
begin
# マッチを一度も行っていないので、例外が発生する。
s.unscan
rescue StringScanner::Error => err
puts err
# 出力例
#=> unscan failed: previous match had failed
end
p s.scan(/\w+/) # => "test"
s.unscan
begin
# 二回以上戻そう......nner::Error => err
puts err
# 出力例
#=> unscan failed: previous match had failed
end
p s.scan(/\w+/) # => "test"
p s.scan(/\w+/) # => nil
begin
# 前回のマッチが失敗しているので、例外が発生する。
s.unscan
rescue => err
puts err
# 出力例
#=> unscan failed... -
MatchData
# offset(n) -> [Integer , Integer] | [nil , nil] (15.0) -
n 番目の部分文字列のオフセットの配列 [start, end] を返 します。
...]{
[ self.begin(n), self.end(n) ]
//}
と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。
@param n 部分文字列を指定する数値
@raise IndexError 範囲外の n を指定した場合に発生します。
@see MatchData#begin, MatchDa... -
MatchData
# offset(name) -> [Integer , Integer] | [nil , nil] (15.0) -
name という名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返 します。
...う名前付きグループに対応する部分文字列のオフセットの配列 [start, end] を返
します。
//emlist[例][ruby]{
[ self.begin(name), self.end(name) ]
//}
と同じです。nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返し......('year') # => [0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end......0, 4]
p $~.offset(:year) # => [0, 4]
p $~.offset('month') # => [5, 6]
p $~.offset(:month) # => [5, 6]
p $~.offset('day') # => [nil, nil]
p $~.offset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#begin, MatchData#end, MatchData#offset... -
Encoding
:: InvalidByteSequenceError # incomplete _ input? -> bool (13.0) -
エラー発生時に入力文字列が不足している場合に真を返します。
...ncoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
ec.convert("abc\xA1z")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "z" on EUC-JP>
p $!.incomplete_input? #=> false
end
begin
ec.convert("abc\xA1")
ec.finish
rescue En... -
Exception
# cause -> Exception | nil (13.0) -
self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、 その前に発生していた元々の例外)を返します。存在しない場合は nil を返し ます。
...合、
その前に発生していた元々の例外)を返します。存在しない場合は nil を返し
ます。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
p $! # => #<RuntimeError: outer>
p $!.cause # => #<RuntimeError: inner>
end...