J
Joe Ruby MUDCRAP-CE
collect seems to work on a hash:
h = {'a'=>'1', 'b'=>'2'}
params = h.collect {|k, v| "#{k}=#{v}"}.join('&')
Yet collect isn't listed as a method of hash:
http://www.ruby-doc.org/core
Is it undocumented, or is some magic going on behind the scenes -- such
as the hash getting converted to an array?
Thanks,
Joe
h = {'a'=>'1', 'b'=>'2'}
params = h.collect {|k, v| "#{k}=#{v}"}.join('&')
Yet collect isn't listed as a method of hash:
http://www.ruby-doc.org/core
Is it undocumented, or is some magic going on behind the scenes -- such
as the hash getting converted to an array?
Thanks,
Joe