Class: Arel::Predicates::Inequality

Inherits:
Binary show all
Defined in:
lib/arel/algebra/predicates.rb,
lib/arel/engines/sql/predicates.rb,
lib/arel/engines/memory/predicates.rb

Instance Method Summary collapse

Methods inherited from Binary

#bind, #to_sql

Methods inherited from Predicate

#and, #not, #or

Instance Method Details

#==(other) ⇒ Object



131
132
133
134
135
# File 'lib/arel/algebra/predicates.rb', line 131

def ==(other)
  Equality === other and
    ((operand1 == other.operand1 and operand2 == other.operand2) or
     (operand1 == other.operand2 and operand2 == other.operand1))
end

#complementObject



137
138
139
# File 'lib/arel/algebra/predicates.rb', line 137

def complement
  Equality.new(operand1, operand2)
end

#eval(row) ⇒ Object



56
57
58
# File 'lib/arel/engines/memory/predicates.rb', line 56

def eval(row)
  operand1.eval(row) != operand2.eval(row)
end

#predicate_sqlObject



56
57
58
# File 'lib/arel/engines/sql/predicates.rb', line 56

def predicate_sql
  operand2.inequality_predicate_sql
end