Improve ruby_002.rb

code golf