123456789_123456789_123456789_123456789_123456789_

Class: Rack::Events::EventedBodyProxy

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, BodyProxy
Instance Chain:
self, BodyProxy
Inherits: Rack::BodyProxy
Defined in: lib/rack/events.rb

Class Method Summary

BodyProxy - Inherited

.new

Set the response body to wrap, and the block to call when the response has been fully sent.

Instance Attribute Summary

BodyProxy - Inherited

#closed?

Whether the proxy is closed.

Instance Method Summary

BodyProxy - Inherited

#close

If not already closed, close the wrapped body and then call the block the proxy was initialized with.

#method_missing

Delegate missing methods to the wrapped body.

#respond_to_missing?

Return whether the wrapped body responds to the method.

Constructor Details

.new(body, request, response, handlers, &block) ⇒ EventedBodyProxy

[ GitHub ]

  
# File 'lib/rack/events.rb', line 82

def initialize(body, request, response, handlers, &block)
  super(body, &block)
  @request  = request
  @response = response
  @handlers = handlers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Rack::BodyProxy

Instance Attribute Details

#request (readonly)

[ GitHub ]

  
# File 'lib/rack/events.rb', line 80

attr_reader :request, :response

#response (readonly)

[ GitHub ]

  
# File 'lib/rack/events.rb', line 80

attr_reader :request, :response

Instance Method Details

#each

[ GitHub ]

  
# File 'lib/rack/events.rb', line 89

def each
  @handlers.reverse_each { |handler| handler.on_send request, response }
  super
end