News for hackers. Stuff that matters.
Re:Live Streaming in Rails 4.0 by masklinn on Tuesday July 31, 2012 @04:32AM (#4316272)
You are mistaken and confused. All IO objects in Ruby use `each` for writing out, non-IO objects use something else to write to IO objects. But from an IO object's perspective, that's a read.

Rack responses are IO objects, so they use #each to write data out. That's perfectly coherent.

Re:Live Streaming in Rails 4.0 by bascule on Tuesday July 31, 2012 @01:25PM (#4318497)
Responding to #each is neither a necessary or sufficient property of Ruby IO objects. You are mistaken and confused.

Don't believe me? Let's undefine #each on the metaclass of an IO object and see what happens. Guess what: it still works!

https://gist.github.com/3218710