instance method Array#none?

none? -> bool[permalink][rdoc][edit]
none? {|obj| ... } -> bool
none?(pattern) -> bool

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

ブロックを指定した場合は、配列のすべての要素をブロックで評価した結果が、すべて偽であれば真を返します。そうでなければ偽を返します。

[PARAM] pattern:
ブロックの代わりに各要素に対して pattern === item を評価します。


%w{ant bear cat}.none? {|word| word.length == 5}  # => true
%w{ant bear cat}.none? {|word| word.length >= 4}  # => false
%w{ant bear cat}.none?(/d/)                       # => true
[].none?                                          # => true
[nil].none?                                       # => true
[nil,false].none?                                 # => true
[nil, false, true].none?                          # => false

[SEE_ALSO] Enumerable#none?