るりまサーチ

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

別のキーワード

  1. enumerable max
  2. enumerable min
  3. enumerable min_by
  4. enumerable max_by
  5. enumerable count

ライブラリ

クラス

モジュール

検索結果

Enumerable#compact -> Array (27114.0)

self から nil を取り除いた配列を生成して返します。

...self から nil を取り除いた配列を生成して返します。

//emlist[][ruby]{
def with_nils
yield 1
yield 2
yield nil
yield 3
end

to_enum(:with_nils).compact # => [1, 2, 3]
//}

@see Array#compact...

Enumerator::Lazy#compact -> Enumerator::Lazy (18134.0)

Enumerable#compact と同じですが、配列ではなく Enumerator::Lazy を返します。

...
Enumerable
#compact と同じですが、配列ではなく Enumerator::Lazy を返します。...