Class: Cuprum::Collections::Basic::Scopes::AllScope

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

Overview

Scope for returning unfiltered data.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Scopes::All

#and, #empty?, #invert, #or, #type

Methods inherited from Base

#match?

Methods inherited from Scopes::Base

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

Methods included from Scopes::Composition

#and, #not, #or

Constructor Details

This class inherits a constructor from Cuprum::Collections::Scopes::Base

Class Method Details

.instanceCuprum::Collections::Basic::Scopes::AllScope

Returns a cached instance of the all scope.

Returns:



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

def self.instance
  @instance ||= new
end

Instance Method Details

#call(data:) ⇒ Object

Filters the provided data.

Raises:

  • (ArgumentError)


19
20
21
22
23
# File 'lib/cuprum/collections/basic/scopes/all_scope.rb', line 19

def call(data:)
  raise ArgumentError, 'data must be an Array' unless data.is_a?(Array)

  data
end