Skip to content

Make eql? behare like ==.#77

Merged
bluemonk merged 2 commits into
ipaddress-gem:masterfrom
smortex:eql
Jan 8, 2022
Merged

Make eql? behare like ==.#77
bluemonk merged 2 commits into
ipaddress-gem:masterfrom
smortex:eql

Conversation

@smortex

@smortex smortex commented Mar 19, 2016

Copy link
Copy Markdown
Contributor

Quoting Object#eql?

For objects of class Object, eql? is synonymous with ==. Subclasses normally continue this tradition by aliasing eql? to their overridden == method

smortex added 2 commits March 19, 2016 11:30
~~~
IPAddress.parse('::1') == IPAddress.parse('::1')   #=> true
IPAddress.parse('::1').eql? IPAddress.parse('::1') #=> false
~~~
~~~
IPAddress.parse('::1') == IPAddress.parse('::1')   #=> true
IPAddress.parse('::1').eql? IPAddress.parse('::1') #=> true
~~~
@smortex

smortex commented Sep 1, 2017

Copy link
Copy Markdown
Contributor Author

For the records, #22 also partially handles this by defining methods (and does more) but no news from submitter.

Either I missed that other PR when opening this one, or I wanted to follow more strictly the "tradition" by aliasing 😉

@Adam21e Adam21e requested review from Adam21e and removed request for francisluong August 10, 2020 04:57

@Adam21e Adam21e left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good and is handy to have.

@grosser

grosser commented Jan 7, 2022

Copy link
Copy Markdown

@kaoudis can this get merged ?

@smortex

smortex commented Jan 7, 2022

Copy link
Copy Markdown
Contributor Author

@Adam21e I can not merge this, maybe you can? Cc @bluemonk

@bluemonk bluemonk merged commit 8ff186b into ipaddress-gem:master Jan 8, 2022
@grosser

grosser commented Jan 8, 2022 via email

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants