update code for ruby