I think my method is a bit awkward, and that there will probably be one liner that I am missing. Ideas?
def _to_hash hsh = {} self.each_slice(2){|v| hsh[v[0]] = v[1]} hsh end 1.9.3-p0 :003 > ["a", 1, "b", 2]._to_hash { "a" => 1, "b" => 2 }
source share