An simple function written in idiomatic Ruby.