Class: Array
- Defined in:
- lib/gems/dm-core-0.9.9/lib/dm-core/support/array.rb
Instance Method Summary collapse
-
#to_hash ⇒ Object
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.
Instance Method Details
#to_hash ⇒ Object
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/gems/dm-core-0.9.9/lib/dm-core/support/array.rb', line 8 def to_hash h = {} self.each{ |k,v| h[k] = v } h end |