class Raindrops::Middleware::Proxy
This class is used by Raindrops::Middleware
to proxy application response bodies. There should be no need to use it directly.
Public Class Methods
Source
# File lib/raindrops/middleware/proxy.rb, line 5 def initialize(body, stats) @body, @stats = body, stats end
Public Instance Methods
Source
# File lib/raindrops/middleware/proxy.rb, line 15 def close @stats.decr_writing @body.close if @body.respond_to?(:close) end
the Rack server should call this after each
(usually ensure-d)
Source
# File lib/raindrops/middleware/proxy.rb, line 10 def each @body.each { |x| yield x } end
yield to the Rack server here for writing
Source
# File lib/raindrops/middleware/proxy.rb, line 36 def method_missing(*args, &block) @body.__send__(*args, &block) end
Avoid breaking users of non-standard extensions (e.g. body) Rack::BodyProxy does the same.
Source
# File lib/raindrops/middleware/proxy.rb, line 29 def respond_to?(m, include_all = false) m = m.to_sym :close == m || @body.respond_to?(m, include_all) end
Rack servers use respond_to?
to check for the presence of close
and to_path
methods.