I mean res.each_hash and res.fetch_hash mysql, not hash method.

-----Mensagem Original----- 
From: 7stud -- 
Sent: Friday, September 09, 2011 4:28 PM Newsgroups: comp.lang.ruby
To: ruby-talk ML
Subject: Re: null pointer given - hash

Angelo Farias wrote in post #1021017:
> each and fetch hash doesnt work

They work fine:

hash = {'a' => 10, 'b' => 20}

hash.each do |key, val|
  puts "#{key} = #{val}"
end

--output:--
a = 10
b = 20


puts hash.fetch('c', "sorry")

--output:--
sorry

-- 
Posted via http://www.ruby-forum.com/.