{"author_name":"osyo-manga","width":"100%","title":"Ruby \u3067\u30aa\u30ec\u30aa\u30ec Outputter \u3092\u5b9a\u7fa9\u3059\u308b","provider_name":"Hatena Blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsecret-garden.hatenablog.com%2Fentry%2F2015%2F05%2F31%2F233348\" title=\"Ruby \u3067\u30aa\u30ec\u30aa\u30ec Outputter \u3092\u5b9a\u7fa9\u3059\u308b - Secret Garden(Instrumental)\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","published":"2015-05-31 23:33:48","image_url":null,"version":"1.0","description":"\u51fa\u529b\u6642\u306b $stdout \u306b\u8a2d\u5b9a\u3057\u305f\u30af\u30e9\u30b9\u306e #write \u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u308b\u306e\u3067\u305d\u3053\u306b\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u307f\u305f\u3044\u3002 [\u30b3\u30fc\u30c9] class CountOutputter def initialize count = 1, output = STDOUT @outputter = STDOUT @count = count end # \u30ca\u30f3\u30d0\u30ea\u30f3\u30b0\u3057\u3066\u51fa\u529b\u3092\u884c\u3046 def write output return @outputter.write output if output == \"\\n\" @outputter.write \"#{@count}. #{output}\u2026","url":"https://secret-garden.hatenablog.com/entry/2015/05/31/233348","categories":["Ruby"],"author_url":"https://blog.hatena.ne.jp/osyo-manga/","provider_url":"https://hatena.blog","blog_title":"Secret Garden(Instrumental)","blog_url":"https://secret-garden.hatenablog.com/","type":"rich"}