Quick Padding your Ruby Array Maricris Nonato Jun 14, 2013 ∙ 1 minute read ruby_arr = %w[0 1 2 3 ] #=> ["0", "1", "2", "3"] rubyarr += (rubyarr.size < 10) ? ['abc'] * (10 - ruby_arr.size) : [] #=> ["0", "1", "2", "3", "abc", "abc", "abc", "abc", "abc", "abc"] The link has been copied!