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

Instance Method Details

#and(hash = nil, &block) ⇒ Object #and(scope) ⇒ Object Also known as: where

Overloads:

  • #and(hash = nil, &block) ⇒ Object

    Returns the none scope.

  • #and(scope) ⇒ Object

    Returns the none scope.



13
14
15
# File 'lib/cuprum/collections/scopes/none.rb', line 13

def and(*, &)
  self
end

#empty?Boolean

Returns false.

Returns:

  • (Boolean)

    false.



19
20
21
# File 'lib/cuprum/collections/scopes/none.rb', line 19

def empty?
  false
end

#invertCuprum::Collections::Scopes::All

Returns an all scope for the current collection.

Returns:



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

Overloads:

  • #not(hash = nil, &block) ⇒ Object

    Returns the none scope.

  • #not(scope) ⇒ Object

    Returns the none scope.



45
46
47
# File 'lib/cuprum/collections/scopes/none.rb', line 45

def not(*, &)
  self
end

#or(hash = nil, &block) ⇒ Object #or(scope) ⇒ Object

Overloads:

  • #or(hash = nil, &block) ⇒ Object

    Returns the none scope.

  • #or(scope) ⇒ Object

    Returns the none scope.



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

#typeSymbol

Returns the scope type.

Returns:

  • (Symbol)

    the scope type.



50
51
52
# File 'lib/cuprum/collections/scopes/none.rb', line 50

def type
  :none
end