るりまサーチ

最速Rubyリファレンスマニュアル検索!
492件ヒット [1-100件を表示] (0.122秒)

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Array#length -> Integer (21209.0)

配列の長さを返します。配列が空のときは 0 を返します。

...配列の長さを返します。配列が空のときは 0 を返します。

//emlist[例][ruby]{
p [1, nil, 3, nil].size #=> 4
//}...

Array#permutation(n = self.length) -> Enumerator (6228.0)

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

...する Enumerator オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整...
...t[例][ruby]{
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.permutatio...
...ermutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
r
esult = []
a.permutation(2) {|e| r...

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

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

...する Enumerator オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整...
...t[例][ruby]{
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.permutatio...
...ermutation of length 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
r
esult = []
a.permutation(2) {|e| r...

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

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

...する Enumerator オブジェクトを返します。

@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@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],...
...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],
# [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
# [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
a.repeated_combinati...

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

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

...する Enumerator オブジェクトを返します。

@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@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],...
...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],
# [1,1,3,3],[1,2,2,2],[1,2,2,3],[1,2,3,3],[1,3,3,3],
# [2,2,2,2],[2,2,2,3],[2,2,3,3],[2,3,3,3],[3,3,3,3]]
a.repeated_combinati...

絞り込み条件を変える

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

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

...する Enumerator オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整...
...list[例][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(...
...=> [[]] # one permutation of length 0
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

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

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

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

...する Enumerator オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整...
...list[例][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(...
...=> [[]] # one permutation of length 0
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

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

Array#sort_by! -> Enumerator (6114.0)

sort_by の破壊的バージョンです。

...sort_by の破壊的バージョンです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
fruits = %w{apple pear fig}
fruits.sort_by! { |word| word.length }
fruits # => ["fig", "pear", "apple"]
//}

@see Enumerable#sort_by...

Array#sort_by! {|item| ... } -> self (6114.0)

sort_by の破壊的バージョンです。

...sort_by の破壊的バージョンです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
fruits = %w{apple pear fig}
fruits.sort_by! { |word| word.length }
fruits # => ["fig", "pear", "apple"]
//}

@see Enumerable#sort_by...
<< 1 2 3 ... > >>