code from the pragmatic studio ruby course