class Array

Public Instance Methods

to_hash() click to toggle source
# File lib/to-hash.rb, line 2
def to_hash
  hash = {}
  self.flatten(1).each_slice(2) do |k, v|
    hash[k] = v
  end

  hash
end