Module: Squeel::Nodes::PredicateOperators

Included in:
Hash, Binary, Function, Grouping, KeyPath, Literal, Nary, Predicate, Sifter, 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.



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



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.



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

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