Rubyのtapとthen 基本 tap then ( = yield_self) 戻り値 レシーバ ブロックの戻り値 text = 'abc' text.tap {|x| x.upcase } #=> 'abc' text.then {|x| x.upcase }... 2026/01/24