DEV Community

Burdette Lamar
Burdette Lamar

Posted on

2 1

About Ruby Hash#compare_by_identity and Hash#compare_by_identity?

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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (2)

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

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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay