After working through exercises for learning Ruby as part of preparation for the upcoming Dev Bootcamp (note: no longer exists), we had a friendly discussion about the exercise to implement a Reverse Polish notation calculator. At the end of discussion, one of the staff members, Jesse, posted his solution to students.
The solution is well-designed, clean, and easy to read. However, one line of code caught my eye:
tokenize(array).inject([]) do |stack, token|
<...>
end.pop