Module: Array::ArrayExtensions

Included in:
Array
Defined in:
lib/ragweed/utils.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject

Convert to hash



5
6
7
8
9
10
11
12
13
14
# File 'lib/ragweed/utils.rb', line 5

def to_hash
    # too clever.
    # Hash[*self.flatten]

    h = Hash.new
    each do |k,v|
        h[k] = v
    end
    h
end