Class: Array

Inherits:
Object show all
Defined in:
lib/core_ext/array.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject

Converts an array of values to a hash. the even indexes are the hash keys the odd indexes are the hash values



6
7
8
9
# File 'lib/core_ext/array.rb', line 6

def to_h
  h = Hash[*self]
  h.symbolize_keys!    
end