Generate a random numbers of N length in Ruby
Array.new(N){proc{rand(9)+1}}.map(&:call).join #=> "12345..N"
Written by Katsuya Hidaka
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#