{"blog_url":"https://obelisk.hatenablog.com/","provider_url":"https://hatena.blog","version":"1.0","height":"190","description":"\u307e\u3053\u3068\u306b FizzBuzz \u306e\u7a2e\u306f\u76e1\u304d\u307e\u3058\u3002 fizzbuzz = Enumerator.new {|y| (1..).each do |i| f = (i % 3).zero? b = (i % 5).zero? y << case when f && b then \"FizzBuzz\" when f then \"Fizz\" when b then \"Buzz\" else i.to_s end end } puts fizzbuzz.take(40) Enumerator \u3068 Endless Range \u306f\u4f7f\u3044\u305f\u3044\u3088\u306d\u3002\u5834\u5408\u5206\u3051\u306f case ~ when\u3002","url":"https://obelisk.hatenablog.com/entry/2021/11/03/131057","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2021%2F11%2F03%2F131057\" title=\"Ruby \u7684\u306b\u81ea\u7136\u306a FizzBuzz - Camera Obscura\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2021-11-03 13:10:57","type":"rich","categories":["Ruby"],"width":"100%","author_url":"https://blog.hatena.ne.jp/obelisk2/","title":"Ruby \u7684\u306b\u81ea\u7136\u306a FizzBuzz","blog_title":"Camera Obscura","provider_name":"Hatena Blog","author_name":"obelisk2"}