{"provider_url":"https://hatena.blog","description":"Block Ruby\u306b\u306f\u30d6\u30ed\u30c3\u30af\u3068\u3044\u3046\u8981\u7d20\u304c\u3042\u308b\u304c\u3001File.open \u306e\u69d8\u306b\u3001 \u5024\u3092\u8fd4\u5374\u3057\u305f\u308a\u3001\u30d6\u30ed\u30c3\u30af\u3067\u6271\u3063\u305f\u308a\u3092\u4e21\u65b9\u51fa\u6765\u308b\u95a2\u6570 \u304c\u3075\u3068\u6c17\u306b\u306a\u3063\u305f\u3002 f = File.open(\"file\") f.each {|l| ... } File.open(\"file\"){ |f| f.each {|l| ... } } block_given? \u3053\u3093\u306a\u95a2\u6570\u3067\u5207\u308a\u5206\u3051\u304c\u51fa\u6765\u308b\u3089\u3057\u3044\u3002 \u4f55\u3068\u3082ruby\u3063\u307d\u3044\uff01 class Block def initialize(num) @a = Array.new (0..num).each { |i| @a[i] = i*10 } end def test (\u2026","categories":["ruby"],"provider_name":"Hatena Blog","author_name":"hiroppon","blog_title":"\u4e2d\u5e74engineer\u306e\u72ec\u308a\u8a00 - crumbjp","author_url":"https://blog.hatena.ne.jp/hiroppon/","blog_url":"https://crumbjp.hateblo.jp/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcrumbjp.hateblo.jp%2Fentry%2F20130411%2F1365644735\" title=\"Ruby\u306e\u30d6\u30ed\u30c3\u30af\u3092\u52c9\u5f37\u3057\u305f - \u4e2d\u5e74engineer\u306e\u72ec\u308a\u8a00 - crumbjp\" 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":"2013-04-11 10:45:35","image_url":null,"type":"rich","url":"https://crumbjp.hateblo.jp/entry/20130411/1365644735","width":"100%","title":"Ruby\u306e\u30d6\u30ed\u30c3\u30af\u3092\u52c9\u5f37\u3057\u305f"}