class Protocol::HTTP::Body::Readable
def each
@yields {|chunk| ...} The block to call with each chunk of data.
Closes the stream when finished or if an error occurs.
Enumerate all chunks until finished, then invoke {close}.
def each return to_enum unless block_given? begin while chunk = self.read yield chunk end rescue => error raise ensure self.close(error) end end