Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/node-marshal.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
20
21
# File 'lib/node-marshal.rb', line 13

def to_h
  h = {}
  a = self
  a.each do |x|
    raise "wrong array length" if x.length != 2
    h[x[0]] = x[1];
  end
  return h
end