るりまサーチ

最速Rubyリファレンスマニュアル検索!
385件ヒット [101-200件を表示] (0.050秒)

別のキーワード

  1. erb result
  2. _builtin result
  3. coverage result
  4. coverage peek_result
  5. erb result_with_hash

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 > >>

Array#combination(n) {|c| block } -> self (21.0)

サイズ n の組み合わせをすべて生成し、それを引数としてブロックを実行します。

...た配列の各要素を引数としてブロックを実
行して 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#permutation(n = self.length) -> Enumerator (21.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result
= []
a.permutation(2) {|e| result << e} # => [1,2,3]
result
# => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#permutation(n = self.length) { |p| block } -> self (21.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result
= []
a.permutation(2) {|e| result << e} # => [1,2,3]
result
# => [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
//}

@see Array#combination, Array#repeated_permutation...

Array#repeated_combination(n) -> Enumerator (21.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result
= []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result
#=> [[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]]
//}

@see...

Array#repeated_combination(n) { |c| ... } -> self (21.0)

サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。

...要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result
= []
a.repeated_combination(3) {|e| result << e} # => [1,2,3]
result
#=> [[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]]
//}

@see...

絞り込み条件を変える

Array#repeated_permutation(n) -> Enumerator (21.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result
= []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result
#=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_com...

Array#repeated_permutation(n) { |p| ... } -> self (21.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result
= []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result
#=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_com...

String#[](substr) -> String | nil (21.0)

self が substr を含む場合、一致した文字列を新しく作って返します。 substr を含まなければ nil を返します。

...た文字列を新しく作って返します。
substr を含まなければ nil を返します。

@param substr 取得したい文字列のパターン。文字列

//emlist[例][ruby]{
substr = "bar"
result
= "foobar"[substr]
p result # => "bar"
p substr.equal?(result) # => false
//}...

String#slice(substr) -> String | nil (21.0)

self が substr を含む場合、一致した文字列を新しく作って返します。 substr を含まなければ nil を返します。

...た文字列を新しく作って返します。
substr を含まなければ nil を返します。

@param substr 取得したい文字列のパターン。文字列

//emlist[例][ruby]{
substr = "bar"
result
= "foobar"[substr]
p result # => "bar"
p substr.equal?(result) # => false
//}...

Array#fetch(nth) -> object (15.0)

nth 番目の要素を返します。

...しなかった場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3, 4, 5]
begin
p a.fetch(10)
rescue IndexError => err
puts err #=> index 10 out of array
end

p a.fetch(10, 999) #=> 999

result
= a.fetch(10){|nth|
print "#{nth} はありません。\n"
999
}
p result #=> 999
//}...

絞り込み条件を変える

<< < 1 2 3 4 > >>