るりまサーチ

最速Rubyリファレンスマニュアル検索!
212件ヒット [1-100件を表示] (0.084秒)
トップページ > クエリ:-[x] > クエリ:on[x] > モジュール:Enumerable[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

キーワード

検索結果

<< 1 2 3 > >>

Enumerable#collect_concat -> Enumerator (6201.0)

各要素をブロックに渡し、その返り値を連結した配列を返します。

各要素をブロックに渡し、その返り値を連結した配列を返します。

ブロックの返り値は基本的に配列を返すべきです。

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

//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}

Enumerable#collect_concat {| obj | block } -> Array (6201.0)

各要素をブロックに渡し、その返り値を連結した配列を返します。

各要素をブロックに渡し、その返り値を連結した配列を返します。

ブロックの返り値は基本的に配列を返すべきです。

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

//emlist[例][ruby]{
[[1,2], [3,4]].flat_map{|i| i.map{|j| j*2}} # => [2,4,6,8]
//}

Enumerable#each_cons(n) -> Enumerator (6201.0)

要素を重複ありで n 要素ずつに区切り、 ブロックに渡して繰り返します。

...素数より大きな数を与えると、ブロックは一度も実行されません。

//emlist[例][ruby]{
(1..10).each_cons(3){|v| p v }
# => [1, 2, 3]
# [2, 3, 4]
# [3, 4, 5]
# [4, 5, 6]
# [5, 6, 7]
# [6, 7, 8]
# [7, 8, 9]
# [8, 9, 10]
//}

@see Enumerable#each_slice...

Enumerable#each_cons(n) {|list| ... } -> nil (6201.0)

要素を重複ありで n 要素ずつに区切り、 ブロックに渡して繰り返します。

...素数より大きな数を与えると、ブロックは一度も実行されません。

//emlist[例][ruby]{
(1..10).each_cons(3){|v| p v }
# => [1, 2, 3]
# [2, 3, 4]
# [3, 4, 5]
# [4, 5, 6]
# [5, 6, 7]
# [6, 7, 8]
# [7, 8, 9]
# [8, 9, 10]
//}

@see Enumerable#each_slice...

Enumerable#each_cons(n) {|list| ... } -> self (6201.0)

要素を重複ありで n 要素ずつに区切り、 ブロックに渡して繰り返します。

...素数より大きな数を与えると、ブロックは一度も実行されません。

//emlist[例][ruby]{
(1..10).each_cons(3){|v| p v }
# => [1, 2, 3]
# [2, 3, 4]
# [3, 4, 5]
# [4, 5, 6]
# [5, 6, 7]
# [6, 7, 8]
# [7, 8, 9]
# [8, 9, 10]
//}

@see Enumerable#each_slice...

絞り込み条件を変える

Enumerable#none? -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトのすべての
要素が偽であれば真を返します。そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトのすべての要素を
ブロックで評価した結...
...'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set[].none? # => true
Set[nil].none? # => true
Set[nil,false].none?...
...# => true
Set[nil, false, true].none? # => false
//}...
...', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none? # => true
Set[nil].none?...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}

@see Array#none?...

Enumerable#none? {|obj| ... } -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトのすべての
要素が偽であれば真を返します。そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトのすべての要素を
ブロックで評価した結...
...'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set[].none? # => true
Set[nil].none? # => true
Set[nil,false].none?...
...# => true
Set[nil, false, true].none? # => false
//}...
...', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none? # => true
Set[nil].none?...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}

@see Array#none?...

Enumerable#none?(pattern) -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトのすべての
要素が偽であれば真を返します。そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトのすべての要素を
ブロックで評価した結...
...', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => false
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none? # => true
Set[nil].none?...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}...
...# => true
Set[nil,false].none? # => true
Set[nil, false, true].none? # => false
//}

@see Array#none?...

Enumerable#one? -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち
ちょうど一つだけが真であれば、真を返します。
そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトの要素を
ブロックで...
...'ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one? # => true
Set[].one?...
...bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one?...
...# => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}...
...# => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}

@see Array#one?...

Enumerable#one? {|obj| ... } -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち
ちょうど一つだけが真であれば、真を返します。
そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトの要素を
ブロックで...
...'ant', 'bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one? # => true
Set[].one?...
...bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one?...
...# => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}...
...# => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}

@see Array#one?...

絞り込み条件を変える

Enumerable#one?(pattern) -> bool (6201.0)

ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち ちょうど一つだけが真であれば、真を返します。 そうでなければ偽を返します。

...ブロックを指定しない場合は、 Enumerable オブジェクトの要素のうち
ちょうど一つだけが真であれば、真を返します。
そうでなければ偽を返します。

ブロックを指定した場合は、Enumerable オブジェクトの要素を
ブロックで...
...bear', 'cat'].one? {|word| word.length == 4} # => true
Set['ant', 'bear', 'cat'].one? {|word| word.length > 4} # => false
Set['ant', 'bear', 'cat'].one?(/t/) # => false
Set[nil, true, 99].one? # => false
Set[nil, true, false].one?...
...# => true
Set[nil, true, 99].one?(Integer) # => true
Set[].one? # => false
//}

@see Array#one?...
<< 1 2 3 > >>