別のキーワード
クラス
- Array (158)
- BasicObject (24)
- Dir (36)
- Fiber (30)
- FrozenError (6)
- Hash (32)
- IO (48)
- Integer (63)
- Module (144)
- Mutex (2)
- Numeric (62)
- Object (60)
-
OpenSSL
:: BN (132) - OptionParser (180)
- Pathname (12)
- Range (16)
- Set (72)
- String (191)
- StringIO (38)
-
Thread
:: Mutex (10) - UnboundMethod (12)
モジュール
- Comparable (24)
キーワード
- ** (11)
- < (12)
- <= (12)
- == (12)
- === (12)
- > (12)
- >= (12)
- [] (90)
- []= (12)
- between? (12)
- bind (12)
- binmode (12)
- bsearch (24)
- bytes (14)
- clamp (12)
-
clear
_ bit! (12) - coerce (12)
- combination (24)
- digits (12)
- disjoint? (12)
-
each
_ byte (48) - entries (7)
-
enum
_ for (24) -
fetch
_ values (22) -
initialize
_ copy (12) - insert (12)
-
instance
_ eval (24) -
instance
_ method (12) - lshift! (12)
-
mask
_ bits! (12) -
mod
_ add (12) -
mod
_ exp (12) -
mod
_ inverse (12) -
mod
_ mul (12) -
mod
_ sub (12) - on (144)
- order! (24)
- overlap? (2)
- permutation (12)
- permute! (12)
- pos= (12)
- pow (22)
-
proper
_ subset? (12) -
proper
_ superset? (12) - public (48)
-
public
_ constant (12) -
public
_ instance _ method (12) - putc (12)
- receiver (6)
- rehash (12)
-
relative
_ path _ from (12) -
repeated
_ combination (24) - resume (12)
- rewind (12)
- rotate! (12)
- rshift! (12)
- sample (24)
- seek (12)
-
set
_ bit! (12) - slice (72)
- step (62)
- subset? (12)
- subtract (12)
- superset? (12)
- synchronize (12)
-
to
_ a (7) -
to
_ enum (24) -
undef
_ method (12) -
unicode
_ normalized? (11) - zip (24)
検索結果
先頭5件
-
Fiber
# raise -> object (21256.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 (21256.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 (21256.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
//}... -
Array
# combination(n) {|c| block } -> self (6238.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
...変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
a.combination(1).to_a #=> [[1],[2],[3],[4]]
a.combination(2).to_a #=> [[1,2],[......1,3],[1,4],[2,3],[2,4],[3,4]]
a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
a.combination(4).to_a #=> [[1,2,3,4]]
a.combination(0).to_a #=> [[]]: one combination of length 0
a.combination(5).to_a #=> [] : no combinations of length 5
//}
ブロックが与えられた場合、作......た配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
result = []
a.combination(2) {|e| result << e} # => [1,2,3,4]
result #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]
//}
@see Array#permutation, Array#repeated_combination... -
Array
# repeated _ combination(n) { |c| . . . } -> self (6238.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3]
a.repeated_combination(1).to_a #=> [[1], [2], [3]]
a.repeated_combination(2).to_a #=> [......[1,1],[1,2],[1,3],[2,2],[2,3],[3,3]]
a.repeated_combination(3).to_a #=> [[1,1,1],[1,1,2],[1,1,3],[1,2,2],[1,2,3],
# [1,3,3],[2,2,2],[2,2,3],[2,3,3],[3,3,3]]
a.repeated_combination(4).to_a #=> [[1,1,1,1],[1,1,1,2],[1,1,1,3],[1,1,2,2],[1,1,2,3],......3]]
a.repeated_combination(0).to_a #=> [[]] # one combination of length 0
//}
ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。
//emlist[例][ruby]{
a = [1, 2, 3]
result = []
a.repeated_combination(3) {|e| r... -
OpenSSL
:: BN # mask _ bits!(n) -> self (6238.0) -
自身を下位 n ビットでマスクし、破壊的に変更します。
...場合は例外 OpenSSL::BNError
が発生します。
//emlist[][ruby]{
require 'openssl'
bn = 0b1111_1111.to_bn
bn.mask_bits!(8)
p "%b" % bn # => "11111111"
bn.mask_bits!(3)
p "%b" % bn # => "111"
//}
@param n マスクするビット数
@raise OpenSSL::BNError 計算時エラ... -
Module
# public _ constant(*name) -> self (6226.0) -
name で指定した定数の可視性を public に変更します。
...指定した定数の可視性を public に変更します。
@param name 0 個以上の String か Symbol を指定します。
@raise NameError 存在しない定数を指定した場合に発生します。
@return self を返します。
//emlist[例][ruby]{
module SampleModule
class Samp......:SampleInnerClass
end
begin
SampleModule::SampleInnerClass
rescue => e
e # => #<NameError: private constant SampleModule::SampleInnerClass referenced>
end
module SampleModule
# => 非公開クラスであることは承知で利用するために public にする
public_constant :SampleIn......nerClass
end
SampleModule::SampleInnerClass # => SampleModule::SampleInnerClass
//}
@see Module#private_constant, Object#untrusted?... -
StringIO
# bytes {|ch| . . . } -> self (6221.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
StringIO
# each _ byte {|ch| . . . } -> self (6221.0) -
自身から 1 バイトずつ読み込み、整数 ch に変換し、それを引数として与えられたブロックを実行します。
...変換し、それを引数として与えられたブロックを実行します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.each_byte{|ch| p ch }
#=> 104
# 111
# 103
# 101
//}
@see IO#each_byte... -
IO
# binmode -> self (6220.0) -
ストリームをバイナリモードにします。MSDOS などバイナリモードの存在 する OS でのみ有効です。そうでない場合このメソッドは何もしません。
...ンしかありません。
@raise Errno::EXXX モードの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.open(IO.sysopen("testfile", "w+")) do |io|
io.binmode? # => false
io.binmode # => #<IO:fd 8>
io.binmode? # => true
end
//}
@see c:IO#io_binmode, IO#binmode?... -
IO
# each _ byte {|ch| . . . } -> self (6220.0) -
IO の現在位置から 1 バイトずつ読み込み、それを整数として与え、ブロックを実行します。
...読み込みメソッドとして動作します。
@raise IOError 自身が読み込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
IO.write("testfile", "aあ")
File.open("testfile") do |io|
io.each_byte { |x| p x }
# => 97
# 227
# 129
# 130
end
//}...