add train.rb with class train