title: How to write a generator in Ruby?
body: <p>In Python, we can write something like this to generate all positive integers:</p>
  
  <pre><code>def integer():
    count = 0
    while True:
      count += 1
      yield count
  </code></pre>
  
  <p>Is there a way to write a similar generator in Ruby?</p>