Class: Cuprum::Collections::Basic::Scopes::ConjunctionScope

Inherits:
Base show all
Includes:
Scopes::Conjunction
Defined in:
lib/cuprum/collections/basic/scopes/conjunction_scope.rb

Overview

Scope for filtering data matching all of the given scopes.

Instance Attribute Summary

Attributes included from Scopes::Container

#scopes

Instance Method Summary collapse

Methods included from Scopes::Conjunction

#and, #invert, #type

Methods included from Scopes::Container

#==, #as_json, #debug, #empty?, #initialize, #with_scopes

Methods inherited from Base

#call

Methods inherited from Scopes::Base

#==, #as_json, #debug, #empty?, #initialize, #invert, #type

Methods included from Scopes::Composition

#and, #not, #or

Instance Method Details

#match?(item:) ⇒ Boolean Also known as: matches?

Returns true if the provided item matches all of the configured scopes.

Returns:

  • (Boolean)


13
14
15
16
17
# File 'lib/cuprum/collections/basic/scopes/conjunction_scope.rb', line 13

def match?(item:)
  super

  scopes.all? { |scope| scope.match?(item:) }
end