.to_a is used to specify range. It is a method that converts an object into an array
Example
$, =", " # Array value separator
range1 = (1..10).to_a
range2 = ('bar'..'bat').to_a
puts "#{range1}"
puts "#{range2}"
Output
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
bar, bas, bat
0 Comment(s)