Module: Cuprum::Collections::Scopes::None
- Included in:
- Basic::Scopes::NoneScope, NoneScope
- Defined in:
- lib/cuprum/collections/scopes/none.rb
Overview
Functionality for implementing a none scope, which returns no data.
Instance Method Summary collapse
- #and ⇒ Object (also: #where)
-
#empty? ⇒ Boolean
False.
-
#invert ⇒ Cuprum::Collections::Scopes::All
An all scope for the current collection.
- #not ⇒ Object
- #or(*args) ⇒ Object
-
#type ⇒ Symbol
The scope type.
Instance Method Details
#and(hash = nil, &block) ⇒ Object #and(scope) ⇒ Object Also known as: where
13 14 15 |
# File 'lib/cuprum/collections/scopes/none.rb', line 13 def and(*, &) self end |
#empty? ⇒ Boolean
Returns false.
19 20 21 |
# File 'lib/cuprum/collections/scopes/none.rb', line 19 def empty? false end |
#invert ⇒ Cuprum::Collections::Scopes::All
Returns an all scope for the current collection.
25 26 27 |
# File 'lib/cuprum/collections/scopes/none.rb', line 25 def invert builder.build_all_scope end |
#not(hash = nil, &block) ⇒ Object #not(scope) ⇒ Object
45 46 47 |
# File 'lib/cuprum/collections/scopes/none.rb', line 45 def not(*, &) self end |
#or(hash = nil, &block) ⇒ Object #or(scope) ⇒ Object
34 35 36 37 38 |
# File 'lib/cuprum/collections/scopes/none.rb', line 34 def or(*args, &) return super if scope?(args.first) builder.build(*args, &) end |
#type ⇒ Symbol
Returns the scope type.
50 51 52 |
# File 'lib/cuprum/collections/scopes/none.rb', line 50 def type :none end |