Originally posted as a private gist
Before I get started, the inspiration behind this was a piece of code written to solve a Ruby exercise: Write a method reverse_words which takes a sentence as a string and reverse each word in it.
The solution that set me on a journey of diving deeper into closures was this one, by Daniela Grossman:
def reverse_words(str)
str.split(' ').map(&:reverse).join(' ')