diff options
author | Austin Ziegler <austin@zieglers.ca> | 2014-04-26 17:18:56 -0400 |
---|---|---|
committer | Austin Ziegler <austin@zieglers.ca> | 2014-04-26 17:18:56 -0400 |
commit | af55df1b1dbce76973bbb732f2af6df167245565 (patch) | |
tree | e7796aee93c3c5c1d585453cf0913893c18dc3ae | |
parent | 194d7be70ff59e26e26e12fbad9b76d9ecc2f8bf (diff) | |
parent | 5b00ec357a82bccb56ee8fe531dd683a2dd7351f (diff) | |
download | diff-lcs-af55df1b1dbce76973bbb732f2af6df167245565.tar.gz |
Merge pull request #29 from GoBoundless/fix_compare
update Change and ContextChange's '==' methods to compare against the other object's class
-rw-r--r-- | lib/diff/lcs/change.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/diff/lcs/change.rb b/lib/diff/lcs/change.rb index 4077095..3104a51 100644 --- a/lib/diff/lcs/change.rb +++ b/lib/diff/lcs/change.rb @@ -54,6 +54,7 @@ class Diff::LCS::Change include Comparable def ==(other) + (self.class == other.class) and (self.action == other.action) and (self.position == other.position) and (self.element == other.element) @@ -159,6 +160,7 @@ class Diff::LCS::ContextChange < Diff::LCS::Change end def ==(other) + (self.class == other.class) and (@action == other.action) and (@old_position == other.old_position) and (@new_position == other.new_position) and |