Li Chen wrote:
> I think I now understand why I can't get expected hash:
>  I do nothing about the value of method call after it returns. Here is 
> the line that returns the hash:
> 
> ...
> h={}
> temp_hash=method2
> h.merge(tem_hash)
> return h
> 

Those 4 lines are equivalent to:

return method2

In ruby, that line looks strange--it looks like you are trying to return 
the method itself.  However, that line is equivalent to:

return method2()

and the call to method2() will be replaced by the return value of 
method2.
-- 
Posted via http://www.ruby-forum.com/.