Bug has been found and fixed after few unit tests which is related to == operation. I also have observed MinMaxHelpers are obsolute in latest ruby versions and didn't remove it yet. I have also learnt usage of hash function and tested to work it out but it apparently doesn't really work so i suggest it to delete @hash variable and hash function for usability. Here is where i have seen from https://ruby-doc.org/core-2.5.3/Hash.html
"A user-defined class may be used as a hash key if the hash and eql? methods are overridden to provide meaningful behavior. By default, separate instances refer to separate hash keys."
Bug has been found and fixed after few unit tests which is related to == operation. I also have observed MinMaxHelpers are obsolute in latest ruby versions and didn't remove it yet. I have also learnt usage of hash function and tested to work it out but it apparently doesn't really work so i suggest it to delete @hash variable and hash function for usability. Here is where i have seen from https://ruby-doc.org/core-2.5.3/Hash.html "A user-defined class may be used as a hash key if the hash and eql? methods are overridden to provide meaningful behavior. By default, separate instances refer to separate hash keys."