aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/engines/memory/predicates.rb
blob: dd2559c70f0884bb3089be042cdc71cf37e778b8 (plain) (tree)
1
2
3
4
5
6
7
8
           




                                                             
       
 


                           
 


                                       
 


                              
 


                                    
 


                           
 


                           
 


                                 
     
   
module Arel
  module Predicates
    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
end