learning ruby snippets