Class: Cuprum::Collections::Basic::Scopes::AllScope
- Inherits:
-
Base
- Object
- Scopes::Base
- Base
- Cuprum::Collections::Basic::Scopes::AllScope
- Includes:
- Scopes::All
- Defined in:
- lib/cuprum/collections/basic/scopes/all_scope.rb
Overview
Scope for returning unfiltered data.
Class Method Summary collapse
-
.instance ⇒ Cuprum::Collections::Basic::Scopes::AllScope
A cached instance of the all scope.
Instance Method Summary collapse
-
#call(data:) ⇒ Object
Filters the provided data.
Methods included from Scopes::All
#and, #empty?, #invert, #or, #type
Methods inherited from Base
Methods inherited from Scopes::Base
#==, #as_json, #debug, #empty?, #initialize, #invert, #type
Methods included from Scopes::Composition
Constructor Details
This class inherits a constructor from Cuprum::Collections::Scopes::Base
Class Method Details
.instance ⇒ Cuprum::Collections::Basic::Scopes::AllScope
Returns a cached instance of the all scope.
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.
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 |