aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sql_algebra/relations/predicates/equality_predicate.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sql_algebra/relations/predicates/equality_predicate.rb')
-rw-r--r--lib/sql_algebra/relations/predicates/equality_predicate.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sql_algebra/relations/predicates/equality_predicate.rb b/lib/sql_algebra/relations/predicates/equality_predicate.rb
new file mode 100644
index 0000000000..2d206e6c12
--- /dev/null
+++ b/lib/sql_algebra/relations/predicates/equality_predicate.rb
@@ -0,0 +1,7 @@
+class EqualityPredicate < BinaryPredicate
+ def ==(other)
+ self.class == other.class and
+ ((attribute1.eql?(other.attribute1) and attribute2.eql?(other.attribute2)) or
+ (attribute1.eql?(other.attribute2) and attribute2.eql?(other.attribute1)))
+ end
+end \ No newline at end of file