Ruby code snippets