Module: Nuggets::Enumerable::AllAnyExtendedMixin

Defined in:
lib/nuggets/enumerable/all_any_extended_mixin.rb

Instance Method Summary collapse

Instance Method Details

#all?(object = default = true, operator = :===, &block) ⇒ Boolean

call-seq:

enum.all?(obj[, operator]) => +true+ or +false+
enum.all? { ... } => +true+ or +false+

Adds the ability to pass an object instead of a block, which will then be tested against each item in enum according to operator, defaulting to :===.

Returns:

  • (Boolean)


38
39
40
# File 'lib/nuggets/enumerable/all_any_extended_mixin.rb', line 38

def all?(object = default = true, operator = :===, &block)
  super(&_block_for_all_any_extended(object, default, operator, &block))
end

#any?(object = default = true, operator = :===, &block) ⇒ Boolean

call-seq:

enum.any?(obj[, operator]) => +true+ or +false+
enum.any? { ... } => +true+ or +false+

Adds the ability to pass an object instead of a block, which will then be tested against each item in enum according to operator, defaulting to :===.

Returns:

  • (Boolean)


49
50
51
# File 'lib/nuggets/enumerable/all_any_extended_mixin.rb', line 49

def any?(object = default = true, operator = :===, &block)
  super(&_block_for_all_any_extended(object, default, operator, &block))
end