You can just splat a range:
[*1..10]
#=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Ruby 1.9 allows multiple splats, which is rather handy:
[*1..3, *?a..?c]
#=> [1, 2, 3, "a", "b", "c"]
You can just splat a range:
[*1..10]
#=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Ruby 1.9 allows multiple splats, which is rather handy:
[*1..3, *?a..?c]
#=> [1, 2, 3, "a", "b", "c"]