code snippets from ruby codeacademy