クラス
- Array (121)
- CSV (11)
- ERB (7)
-
Encoding
:: Converter (11) -
Gem
:: DependencyList (11) -
JSON
:: State (11) - Object (11)
- StopIteration (11)
- String (132)
-
Thread
:: Mutex (9) -
WIN32OLE
_ PARAM (11)
モジュール
- Enumerable (66)
キーワード
- [] (66)
-
_ dump (11) - combination (22)
- fetch (33)
- generate (11)
- inject (33)
- output? (11)
- permutation (22)
-
primitive
_ errinfo (11) - reduce (33)
-
repeated
_ combination (22) -
repeated
_ permutation (22) -
result
_ with _ hash (7) - slice (66)
-
spec
_ predecessors (11) - synchronize (9)
-
write
_ headers? (11)
検索結果
先頭5件
-
StopIteration
# result -> object (24108.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
p error.result #=> :each_returned
end... -
Array
# repeated _ combination(n) -> Enumerator (15521.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行
します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返し......ます。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えな......{
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.... -
Array
# repeated _ permutation(n) -> Enumerator (15509.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成......to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2]
a.repeated_permutation(1).to_a #=>......[[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one permutation of length 0
//}
ブロッ... -
Array
# repeated _ combination(n) { |c| . . . } -> self (15421.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
...サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行
します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返し......ます。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えな......{
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.... -
Array
# repeated _ permutation(n) { |p| . . . } -> self (15409.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
...サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成......to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2]
a.repeated_permutation(1).to_a #=>......[[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one permutation of length 0
//}
ブロッ... -
JSON
:: State # generate(obj) -> String (15249.0) -
Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.
...Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception.... -
Array
# combination(n) -> Enumerator (12433.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
... n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、組み合わせ
を生成する Enumerator オブジェクトを返します。
@param......to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
a.combination(1).to_a #=> [[......,[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
//}... -
Array
# permutation(n = self . length) -> Enumerator (12433.0) -
サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
...サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。
引数を省略した場合は配列の要素数と同じサイズの順列に対してブロックを実
行します。
得られる順列の順序は保証されません。ブロックなし......を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引......]{
a = [1, 2, 3]
a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(1).to_a #=> [[1],[2],[3]]
a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(0).to_a... -
ERB
# result _ with _ hash(hash) -> String (12408.0) -
ERB をハッシュオブジェクトで指定されたローカル変数を持つ 新しいトップレベルバインディングで実行し、結果の文字列を返します。
...ERB をハッシュオブジェクトで指定されたローカル変数を持つ
新しいトップレベルバインディングで実行し、結果の文字列を返します。
@param hash ローカル変数名をキーにしたハッシュ
@see ERB#result... -
Array
# combination(n) {|c| block } -> self (12333.0) -
サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
... n の組み合わせをすべて生成し、それを引数としてブロックを実行します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、組み合わせ
を生成する Enumerator オブジェクトを返します。
@param......to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [1, 2, 3, 4]
a.combination(1).to_a #=> [[......,[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
//}...