I initialize my array
my_array = Array.new(26)
and then try to populate it
my_array[0..25] = ["A".."Z"]
# => "A".."Z"
Same output when I try:
my_array[0..25] = "A".upto("Z")
# => "A".."Z"
When I try using a block:
my_array[0..25] = "A".upto("Z") { |l| l} #=> "A"
my_array
# => ["A"]
When after trying the first or second method of populating above, I inspect my_array:
my_array
# => ["A".."F"]
which I understand is an enumerator. So I try:
my_array.each {|l| p l}
but all I'm returned is
"A..F"
# => ["A".."F"]
What is actually being stored in the array?
How can I correctly implement the populating of the array with the letters of the alphabet?