Sha256: a056c43bdd42b69704bed3566c2ee2f1130879c2a9234541590fa9711844b8e7
Contents?: true
Size: 840 Bytes
Versions: 19
Compression:
Stored size: 840 Bytes
Contents
module Merb module Rack class StreamWrapper # :api: private def initialize(body) @body = body end # :api: private def each(&callback) if Proc === @body @writer = lambda { |x| callback.call(x) } @body.call(self) elsif @body.is_a?(String) @body.each_line(&callback) else @body.each(&callback) end end # :api: private def write(str) @writer.call str.to_s str end # :api: private def to_s @body.to_s end # :api: private def ==(other) @body == other end # :api: private def method_missing(sym, *args, &blk) @body.send(sym, *args, &blk) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems