class Rack::Brotli::Deflater::BrotliStream
Public Class Methods
new(body, options)
click to toggle source
# File lib/rack/brotli/deflater.rb 69 def initialize(body, options) 70 @body = body 71 @options = options 72 end
Public Instance Methods
close()
click to toggle source
# File lib/rack/brotli/deflater.rb 86 def close 87 @body.close if @body.respond_to?(:close) 88 end
each() { |deflate| ... }
click to toggle source
# File lib/rack/brotli/deflater.rb 74 def each(&block) 75 @writer = block 76 # Use String.new instead of '' to support environments with strings frozen by default. 77 buffer = String.new 78 @body.each { |part| 79 buffer << part 80 } 81 yield ::Brotli.deflate(buffer, @options) 82 ensure 83 @writer = nil 84 end