ActiveSupport still has a wonderfully readable implementation:
https://github.com/rails/rails/blob/b0c813bc7b61c71dd21ee3a6...
Though I don't really use Rails that often any more, I still miss some of the niceties.