diff-lcs
diff-lcs copied to clipboard
Add documentation how to override object equality
It is unclear to me if (at all) and how to define what constitutes equality for diff-lcs. I tried overriding == operator but this did not work.
Looking into the code it seems Hash equality needs to be implemented (i.e. eql? and hash).
https://github.com/halostatue/diff-lcs/blob/e4b02743f4f2d40cd43b0ec9071d6a5ba9787336/lib/diff/lcs/internals.rb#L294
Would it make sense to document this?
It would be. I’d suggest that it might be worth adding some tests to verify this.