diff options
Diffstat (limited to 'lib/arel/engines/memory/predicates.rb')
-rw-r--r-- | lib/arel/engines/memory/predicates.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/arel/engines/memory/predicates.rb b/lib/arel/engines/memory/predicates.rb new file mode 100644 index 0000000000..03d4f25b0a --- /dev/null +++ b/lib/arel/engines/memory/predicates.rb @@ -0,0 +1,35 @@ +module Arel + class Binary < Predicate + def eval(row) + operand1.eval(row).send(operator, operand2.eval(row)) + end + end + + class Equality < Binary + def operator; :== end + end + + class GreaterThanOrEqualTo < Binary + def operator; :>= end + end + + class GreaterThan < Binary + def operator; :> end + end + + class LessThanOrEqualTo < Binary + def operator; :<= end + end + + class LessThan < Binary + def operator; :< end + end + + class Match < Binary + def operator; :=~ end + end + + class In < Binary + def operator; :include? end + end +end |