別のキーワード
ライブラリ
クラス
-
ARGF
. class (36) - Array (392)
- BasicObject (36)
- Binding (12)
- Dir (24)
-
Encoding
:: Converter (24) - Enumerator (36)
-
Enumerator
:: Lazy (48) - Exception (56)
- Fiber (42)
-
File
:: Stat (12) - Float (24)
- FrozenError (6)
- Hash (68)
- IO (104)
-
IRB
:: ExtendCommand :: Load (12) - Integer (87)
- MatchData (22)
- Matrix (50)
- Module (264)
- Mutex (2)
- Numeric (62)
- Object (180)
-
OpenSSL
:: BN (216) - OptionParser (276)
- Pathname (12)
-
Rake
:: InvocationChain (12) - Range (204)
- Rational (12)
- Set (72)
- String (206)
- StringIO (110)
- StringScanner (24)
- Struct (24)
- Thread (17)
-
Thread
:: Mutex (10) - TracePoint (62)
- UnboundMethod (12)
- WIN32OLE (36)
-
WIN32OLE
_ TYPELIB (12)
モジュール
- Comparable (72)
- Enumerable (156)
- Kernel (12)
-
OptionParser
:: Arguable (60)
キーワード
- ** (11)
- + (12)
- < (24)
- << (12)
- <= (24)
- <=> (12)
- == (24)
- === (12)
- > (24)
- >= (24)
- >> (12)
- [] (138)
- []= (48)
- antisymmetric? (7)
- append (12)
- at (12)
- backtrace (12)
-
backtrace
_ locations (12) - begin (24)
- between? (12)
- bind (12)
- binmode (12)
- birthtime (12)
- bsearch (48)
- bytebegin (2)
- byteend (2)
- byteindex (3)
- byteoffset (6)
- bytes (14)
-
callee
_ id (12) - chunk (12)
- clamp (12)
-
class
_ variable _ get (12) -
clear
_ bit! (12) - clone (12)
- cmp (12)
- coerce (12)
-
cofactor
_ expansion (12) -
collect
_ concat (12) - combination (24)
-
const
_ get (12) - convert (12)
- cycle (24)
-
define
_ method (24) -
delete
_ at (12) - detect (24)
- digits (12)
- disjoint? (12)
- dup (12)
-
each
_ byte (48) - end (12)
- entries (7)
-
enum
_ for (36) - eof (12)
- eof? (12)
- event (12)
- execute (12)
- feed (12)
- fetch (80)
-
fetch
_ values (22) - find (24)
- finish (12)
- first (36)
-
flat
_ map (12) - gem (12)
- getbyte (12)
- getopts (36)
-
initialize
_ copy (12) - insert (12)
- inspect (12)
-
instance
_ eval (24) -
instance
_ method (12) -
instruction
_ sequence (7) - intersection (6)
- isatty (12)
-
laplace
_ expansion (12) - last (36)
-
local
_ variable _ get (12) - lshift! (12)
-
mask
_ bits! (12) - max (94)
- method (12)
-
method
_ id (12) -
method
_ missing (12) - min (94)
-
mod
_ add (12) -
mod
_ exp (12) -
mod
_ inverse (12) -
mod
_ mul (12) -
mod
_ sub (12) - next (12)
-
ole
_ query _ interface (12) - on (144)
- order (48)
- order! (48)
- overlap? (2)
- parameters (7)
- parse! (12)
- path (12)
- peek (24)
- peep (12)
- permutation (12)
- permute (24)
- permute! (24)
- pop (12)
- pow (22)
- pread (8)
-
prime
_ fasttest? (12) - print (12)
- printf (12)
- private (48)
-
proper
_ subset? (12) -
proper
_ superset? (12) - public (48)
-
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ send (24) - putc (12)
- puts (12)
- readbyte (36)
- receiver (6)
- regular? (12)
- rehash (12)
-
relative
_ path _ from (12) -
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
repeated
_ combination (24) -
report
_ on _ exception (9) -
respond
_ to? (12) - resume (12)
-
return
_ value (12) - rewind (12)
- rotate (12)
- rotate! (12)
- rshift! (12)
- sample (24)
- seek (12)
-
set
_ backtrace (12) -
set
_ bit! (12) - setbyte (12)
- setproperty (24)
- shift (12)
-
singleton
_ class (12) -
singleton
_ method (12) -
skew
_ symmetric? (7) - slice (72)
- step (62)
- subset? (12)
- subtract (12)
- superset? (12)
- sync (12)
- synchronize (12)
-
to
_ a (7) -
to
_ d (36) -
to
_ enum (36) -
to
_ s (24) - transfer (12)
- tty? (12)
- ucmp (12)
-
undef
_ method (12) -
unicode
_ normalized? (11) -
values
_ at (12) - write (12)
- zip (24)
検索結果
先頭5件
-
Fiber
# raise -> object (21340.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。...... backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fib......er.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (21340.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。...... backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fib......er.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Fiber
# raise(message) -> object (21340.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。...... backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fib......er.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (6325.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_......00, 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 `ge......t_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Array
# bsearch -> Enumerator (6291.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
...本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結......返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch {|x| x >= 4 } # => 4
ary.bsearch {|x| x >= 6 } # => 7
ary.bsearch {|x| x >= -1 } # => 0
ary.bsearch {|x| x >= 100 } # => nil
//}
find-any モードは bsearch(3) のように動作します。ブロッ......クは真偽値
ではなく、以下のような数値を返す必要があります。求める要素が配列の i 番目
から j-1 番目までに入っているとします。またブロックパラメータの値の
インデックスを k とします。
* ブロックパラメータの... -
Array
# bsearch { |x| . . . } -> object | nil (6291.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値を二分探 索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返し ます。self はあらかじめソートしておく必要があります。
...本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結......返すか、nil を返します。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch {|x| x >= 4 } # => 4
ary.bsearch {|x| x >= 6 } # => 7
ary.bsearch {|x| x >= -1 } # => 0
ary.bsearch {|x| x >= 100 } # => nil
//}
find-any モードは bsearch(3) のように動作します。ブロッ......クは真偽値
ではなく、以下のような数値を返す必要があります。求める要素が配列の i 番目
から j-1 番目までに入っているとします。またブロックパラメータの値の
インデックスを k とします。
* ブロックパラメータの... -
MatchData
# bytebegin(n) -> Integer | nil (6273.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されていない name を指定した場合に発生します。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~......2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexError)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~......# => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo (IndexError)
//}... -
MatchData
# bytebegin(name) -> Integer | nil (6273.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されていない name を指定した場合に発生します。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~......2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexError)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~......# => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo (IndexError)
//}... -
MatchData
# byteend(n) -> Integer | nil (6273.0) -
n 番目の部分文字列終端のバイトオフセットを返します。
...字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されていない name を指定した場合に発生します。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ #......$~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" k......ey:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}... -
MatchData
# byteend(name) -> Integer | nil (6273.0) -
n 番目の部分文字列終端のバイトオフセットを返します。
...字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されていない name を指定した場合に発生します。
//emlist[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ #......$~.byteend(0) # => 15
p $~.byteend(1) # => 3
p $~.byteend(2) # => 12
p $~.byteend(3) # => 15
p $~.byteend(4) # => index 4 out of matches (IndexError)
//}
//emlist[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" k......ey:"name" value:"ruby">
$~.byteend(:key) # => 4
$~.byteend(:value) # => 10
$~.byteend(:foo) # => undefined group name reference: foo (IndexError)
//}... -
Range
# bsearch -> Enumerator (6273.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
...本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結......。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil
(0.0...Float::INFINITY).bsearch {|x| Math.log(x)......>= 0 } # => 1.0
//}
find-any モードは bsearch(3) のように動作します。ブロックは真偽値
ではなく、以下のような数値を返す必要があります。求める値の範囲がx...y
(x <= y)であるとします。また、ブロックパラメータの値を v と... -
Range
# bsearch {|obj| . . . } -> object | nil (6273.0) -
ブロックの評価結果で範囲内の各要素の大小判定を行い、条件を満たす値を二 分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を 返します。
...本メソッドはブロックを評価した結果により以下のいずれかのモードで動作し
ます。
* find-minimum モード
* find-any モード
find-minimum モード(特に理由がない限りはこのモードを使う方がいいでしょ
う)では、条件判定の結......。
//emlist[例][ruby]{
ary = [0, 4, 7, 10, 12]
(0...ary.size).bsearch {|i| ary[i] >= 4 } # => 1
(0...ary.size).bsearch {|i| ary[i] >= 6 } # => 2
(0...ary.size).bsearch {|i| ary[i] >= 8 } # => 3
(0...ary.size).bsearch {|i| ary[i] >= 100 } # => nil
(0.0...Float::INFINITY).bsearch {|x| Math.log(x)......>= 0 } # => 1.0
//}
find-any モードは bsearch(3) のように動作します。ブロックは真偽値
ではなく、以下のような数値を返す必要があります。求める値の範囲がx...y
(x <= y)であるとします。また、ブロックパラメータの値を v と... -
File
:: Stat # birthtime -> Time (6267.0) -
作成された時刻を返します。
...@raise NotImplementedError Windows のような birthtime のない環境で発生します。
//emlist[][ruby]{
File.write("testfile", "foo")
sleep 10
File.write("testfile", "bar")
sleep 10
File.chmod(0644, "testfile")
sleep 10
File.read("testfile")
File.stat("testfile").birthtime #=> 2014-02-2......4 11:19:17 +0900
File.stat("testfile").mtime #=> 2014-02-24 11:19:27 +0900
File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
File.stat("testfile").atime #=> 2014-02-24 11:19:47 +0900
//}... -
String
# byteindex(pattern , offset = 0) -> Integer | nil (6249.0) -
文字列の offset から右に向かって pattern を検索し、 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...ット
@raise IndexError オフセットが文字列の境界以外をさしているときに発生します。
//emlist[例][ruby]{
'foo'.byteindex('f') # => 0
'foo'.byteindex('o') # => 1
'foo'.byteindex('oo') # => 1
'foo'.byteindex('ooo') # => nil
'foo'.byteindex(/f/) # => 0
'foo'.byteindex(/o......'.byteindex(/oo/) # => 1
'foo'.byteindex(/ooo/) # => nil
'foo'.byteindex('o', 1) # => 1
'foo'.byteindex('o', 2) # => 2
'foo'.byteindex('o', 3) # => nil
'foo'.byteindex('o', -1) # => 2
'foo'.byteindex('o', -2) # => 1
'foo'.byteindex('o', -3) # => 1
'foo'.byteindex('o', -4) # => nil
'あいう'.byt......eindex('う') # => 6
'あいう'.byteindex('う', 3) # => 6
'あいう'.byteindex('う', -3) # => 6
'あいう'.byteindex('う', 1) # offset 1 does not land on character boundary (IndexError)
//}
@see String#index, String#byterindex... -
String
# setbyte(index , b) -> Integer (6242.0) -
index バイト目のバイトを b に変更します。
...目のバイトを b に変更します。
index に負を指定すると末尾から数えた位置を変更します。
セットした値を返します。
@param index バイトをセットする位置
@param b セットするバイト(0 から 255 までの整数)
@raise IndexError 範囲外......に値をセットしようとした場合に発生します。
//emlist[例][ruby]{
s = "Sunday"
s.setbyte(0, 77)
s.setbyte(-5, 111)
s # => "Monday"
//}...