Class: ActionDispatch::Response::BodyBuster
- Inherits:
-
Object
- Object
- ActionDispatch::Response::BodyBuster
- Defined in:
- lib/action_dispatch/http/response.rb
Overview
:nodoc:
Instance Method Summary collapse
- #bust(body) ⇒ Object
-
#initialize(response) ⇒ BodyBuster
constructor
A new instance of BodyBuster.
- #write(string) ⇒ Object
Constructor Details
#initialize(response) ⇒ BodyBuster
Returns a new instance of BodyBuster.
119 120 121 122 |
# File 'lib/action_dispatch/http/response.rb', line 119 def initialize(response) @response = response @body = "" end |
Instance Method Details
#bust(body) ⇒ Object
124 125 126 127 128 |
# File 'lib/action_dispatch/http/response.rb', line 124 def bust(body) body.call(@response, self) body.close if body.respond_to?(:close) @body end |
#write(string) ⇒ Object
130 131 132 |
# File 'lib/action_dispatch/http/response.rb', line 130 def write(string) @body << string.to_s end |