Class: Rack::Events::EventedBodyProxy

Inherits:
BodyProxy
  • Object
show all
Defined in:
lib/rack/events.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BodyProxy

#close, #closed?, #method_missing, #respond_to?

Constructor Details

#initialize(body, request, response, handlers, &block) ⇒ EventedBodyProxy

Returns a new instance of EventedBodyProxy.



79
80
81
82
83
84
# File 'lib/rack/events.rb', line 79

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

#requestObject (readonly)

Returns the value of attribute request.



77
78
79
# File 'lib/rack/events.rb', line 77

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



77
78
79
# File 'lib/rack/events.rb', line 77

def response
  @response
end

Instance Method Details

#eachObject



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

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