implemented the bob exercise with ruby classes