training code for ruby