solve ruby proc puzzle