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!