Module: Cuprum::Collections::Scopes::All
- Included in:
- Basic::Scopes::AllScope, AllScope
- Defined in:
- lib/cuprum/collections/scopes/all.rb
Overview
Functionality for implementing an all scope, which returns all data.
Instance Method Summary collapse
- #and(*args) ⇒ Object (also: #where)
-
#empty? ⇒ Boolean
False.
-
#invert ⇒ Cuprum::Collections::Scopes::None
A none scope for the current collection.
- #or(*args) ⇒ Object
-
#type ⇒ Symbol
The scope type.
Instance Method Details
#and(hash = nil, &block) ⇒ Object #and(scope) ⇒ Object Also known as: where
15 16 17 18 19 |
# File 'lib/cuprum/collections/scopes/all.rb', line 15 def and(*args, &) return self if scope?(args.first) && args.first.empty? builder.build(*args, &) end |
#empty? ⇒ Boolean
Returns false.
23 24 25 |
# File 'lib/cuprum/collections/scopes/all.rb', line 23 def empty? false end |
#invert ⇒ Cuprum::Collections::Scopes::None
Returns a none scope for the current collection.
29 30 31 |
# File 'lib/cuprum/collections/scopes/all.rb', line 29 def invert builder.build_none_scope end |
#or(hash = nil, &block) ⇒ Object #or(scope) ⇒ Object
40 41 42 43 44 |
# File 'lib/cuprum/collections/scopes/all.rb', line 40 def or(*args, &) return self if scope?(args.first) && args.first.empty? builder.build(*args, &) end |
#type ⇒ Symbol
Returns the scope type.
47 48 49 |
# File 'lib/cuprum/collections/scopes/all.rb', line 47 def type :all end |