I am trying to store values from an array, to a hash (array value is the key, value just 0). Here is my code. Any ideas?
[1, 2, 3, 4].inject({}) {|result, e| result[e] = 0}
This is the error I am getting.
oMethodError: undefined method `[]=' for 0:Fixnum
from (irb):1
from (irb):1:in `inject'
from (irb):1:in `each'
from (irb):1:in `inject'
from (irb):1
from :0