るりまサーチ (Ruby 3.2)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.057秒)
トップページ > クエリ:-[x] > クエリ:end[x] > クエリ:to_enum[x] > バージョン:3.2[x] > クエリ:compact[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

モジュール

検索結果

Enumerable#compact -> Array (54676.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