I've looked through these docs and Google, and can't seem to find the purpose of .rewind, and how it differs from .close, in the context of working with a Tempfile. Also, why does .read return an empty string before rewinding? Here is an example: file = Tempfile.new('foo') file.path # => A unique filename in the OS's temp directory, # e.g.: "/tmp/foo.24722.0" # This filename contains 'foo' in its
![What does the .rewind method do on a Tempfile in ruby?](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)