DEV Community

loading...

About Ruby Hash#compare_by_identity and Hash#compare_by_identity?

burdettelamar profile image Burdette Lamar ・1 min read

Get more information and more examples at my AboutRuby project:

Here's the write-up over at the Ruby project:

My main page is here.

TL;DR

I've been working on enhancements to the documentation for the Ruby project. Getting these enhancements posted to the Ruby project has been very slow. They're not actually meeting resistance; I know because my many PRs for enhancing class ENV were accepted (though not rapidly). It's just that everyone is busy.

Anyhow, I'm stashing all this stuff on in my own project, called AboutRuby. The piecemeal migration from there to the Ruby project is not going to be completed in my lifetime (I'm 77 years old).

So: I'm going to blow my own horn here on DEV, to encourage you to use the enhanced documentation.

Discussion (2)

pic
Editor guide
Collapse
isalevine profile image
Isa Levine • Edited

As always, great writeup--compare_by_identity is totally new to me and looks really useful!

Just cuz I'm nitpicky--small typo in the 2nd part of compare_by_identity:

After calling compare_by_identity, the keys are considered different, the therefore do not overwrite:

Thanks for sharing this! :)

Collapse
burdettelamar profile image
Burdette Lamar Author

Thanks, Isa! Fixed. I like nitpicky, so if you see anything else, squawk. Or open a PR if you like.