CodeKata 2 for Ruby

This is a very rough implementation and needs refactoring.