Kang-Kyu Lee

November 3, 2024

Ruby itself

in Ruby, there's this "itself" method.

If you say thing1.itself, it returns the value of thing1.

Yes, it is used sometimes, for example group_by(&:itself) will group a list by element itself!

That's it for today.

See you next time!

About Kang-Kyu Lee

I love hamburgers. I will share my experiences with Ruby, Go, Kotlin, Swift