{"title":"","provider_name":"Hatena Blog","published":"2008-01-18 01:30:39","categories":["ruby"],"image_url":null,"blog_title":"Learning to be Me","version":"1.0","url":"https://bubbles.hatenadiary.org/entry/20080118/1200673839","blog_url":"https://bubbles.hatenadiary.org/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbubbles.hatenadiary.org%2Fentry%2F20080118%2F1200673839\" title=\" - Learning to be Me\" 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","author_url":"https://blog.hatena.ne.jp/bubbles/","provider_url":"https://hatena.blog","author_name":"bubbles","type":"rich","description":"\u5916\u90e8\u30a4\u30c6\u30ec\u30fc\u30bf\u306b\u3064\u3044\u3066\u30e1\u30e2\u3002 require 'generator' g = Generator.new([1,2,3]) while g.next? puts g.next end \u3063\u3066\u3084\u308c\u3070\u3001Ruby\u3067\u5916\u90e8\u30a4\u30c6\u30ec\u30fc\u30bf\u304c\u4f7f\u3048\u308b\u3002\u3067\u30012\u3064\u4ee5\u4e0a\u3092\u30a4\u30c6\u30ec\u30fc\u30c8\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u3001 require 'generator' s = SyncEnumerator.new([1,2,3], ['a', 'b', 'c']) s.each do |row| puts row end \u3063\u3066\u3084\u3063\u3066\u3042\u3052\u308c\u3070OK\u3002\u3069\u3063\u3061\u304b\u304c\u77ed\u3044\u5834\u5408\u306f\u305d\u3053\u306bnil\u304c\u5165\u308b\u3002\u3053\u308c\u3092\u5916\u90e8\u30a4\u30c6\u30ec\u30fc\u30bf\u306a\u3057\u3067\u3084\u308b\u306a\u3089 [1,2,3].zip(['a'\u2026","width":"100%"}