Module: Squeel::Nodes::PredicateOperators

Included in:
Hash, Binary, KeyPath, Nary, Predicate, Unary
Defined in:
lib/squeel/nodes/predicate_operators.rb

Overview

Operators that act as factories for Or, And, and Not nodes for inclusion in classes which can be contained inside these nodes.

Instance Method Summary collapse

Instance Method Details

#&(other) ⇒ And

Create a new And node, with this node as its left-hand node.

Parameters:

  • other

    The right-hand node for the And

Returns:

  • (And)

    The new And node



17
18
19
# File 'lib/squeel/nodes/predicate_operators.rb', line 17

def &(other)
  And.new([self, other])
end

#-@Not

Create a new Not node, with this node as its expression

Returns:

  • (Not)

    The new Not node



23
24
25
# File 'lib/squeel/nodes/predicate_operators.rb', line 23

def -@
  Not.new(self)
end

#|(other) ⇒ Or

Create a new Or node, with this node as its left-hand node.

Parameters:

  • other

    The right-hand node for the Or

Returns:

  • (Or)

    The new Or node



10
11
12
# File 'lib/squeel/nodes/predicate_operators.rb', line 10

def |(other)
  Or.new(self, other)
end