Update Ruby code and rspec test