> as expected. but if i put it inside a method

AFAIK the way return inside a block works has changed in ruby 1.9
though (it then returns from the block).