{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxyuyux.hatenadiary.org%2Fentry%2F20120908%2F1347076291\" title=\"Ruby\u3067flip - xyuyux\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","type":"rich","blog_url":"https://xyuyux.hatenadiary.org/","width":"100%","author_name":"xyuyux","blog_title":"xyuyux\u306e\u65e5\u8a18","image_url":null,"title":"Ruby\u3067flip","provider_name":"Hatena Blog","version":"1.0","height":"190","published":"2012-09-08 12:51:31","description":"\u95a2\u6570\u5408\u6210\u3067\u304d\u305f\u3002\u30dd\u30a4\u30f3\u30c8\u30d5\u30ea\u30fc\u304c\u3067\u304d\u305f\u3002\u30ab\u30ea\u30fc\u5316\u3082\u3042\u308b\u3002 \u306a\u3089\u6b21\u306fflip\u3067\u90e8\u5206\u9069\u5fdc\u306e\u9806\u5e8f\u3092\u5165\u308c\u304b\u3048\u3066\u3084\u308a\u305f\u3044\u3002 \u307e\u305a\u306f\u4e0b\u8a18\u306eProc#flip\u3092\u898b\u3066\u8a66\u3059\u3002 http://yuroyoro.hatenablog.com/entry/2012/08/10/232443 div = lambda{|x,y| x.to_f / y } div.(10,2) #=> 5.0 div.flip.(10,2) #=> 0.2 \u78ba\u304b\u306b\u3067\u304d\u3066\u308b\u3002\u3067\u30823\u3064\u5f15\u6570\u3092\u3068\u308b\u5834\u5408\u3001\u7b2c2\u5f15\u6570\u3068\u7b2c3\u5f15\u6570\u3092\u90e8\u5206\u9069\u5fdc\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3089\u3057\u3044\u3002 \u3084\u3063\u3066\u307f\u308b\u3002 f = ->a,b,s { s.to_s.gsub(a, b) } p \u2026","url":"https://xyuyux.hatenadiary.org/entry/20120908/1347076291","categories":["Ruby"],"author_url":"https://blog.hatena.ne.jp/xyuyux/"}