Module: Enumerable

Defined in:
lib/rubyexts/enumerable.rb

Instance Method Summary collapse

Instance Method Details

#none? {|block| ... } ⇒ Array<String>

Enumerable#none? is the logical opposite of the builtin method Enumerable#any?. It returns true if and only if none of the elements in the collection satisfy the predicate.

If no predicate is provided, Enumerable#none? returns true if and only if none of the elements have a true value (i.e. not nil or false).

Examples:

[].none?                      # => true
[nil].none?                   # => true
[5,8,9].none?                 # => false
(1...10).none? { |n| n < 0 }  # => true
(1...10).none? { |n| n > 0 }  # => false

Parameters:

  • params (Hash)

    a customizable set of options

Yields:

  • (block)

    Block which will be evaluated in Project.setttings object.

Yield Parameters:

  • Each (item)

    item of array-like collection

  • Each (key, value)

    item of hash-like collection

Returns:

  • (Array<String>)

    List of successfully loaded files

Raises:

  • (LoadError)

    If base directory doesn’t exist

  • (ArgumentError)

    If first argument isn’t a glob

Author:

  • Botanicus

Since:

  • 0.0.3



27
28
29
# File 'lib/rubyexts/enumerable.rb', line 27

def none?(&block)
  not self.any?(&block)
end