Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-core/support/array.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject

atm it assumes self is an array of [key,value]-arrays this is just a better way to make hashes than Hash since you cannot flatten only one level in ruby 1.8.6



8
9
10
11
12
# File 'lib/dm-core/support/array.rb', line 8

def to_hash
  h = {}
  self.each{ |k,v| h[k] = v }
  h
end