envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Implement Event#hash method #140

Closed orien closed 7 years ago

orien commented 7 years ago

From the description of #hash in the Ruby docs:

This function must have the property that a.eql?(b) implies a.hash == b.hash.

Now Event#hash satisfies this constraint as it has been brought in line with our custom Event#eql? implementation.

This should avoid any weirdness when using Event instances as hash keys.