Class: ActionDispatch::Response::BodyBuster

Inherits:
Object
  • Object
show all
Defined in:
lib/action_dispatch/http/response.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ BodyBuster

Returns a new instance of BodyBuster.



120
121
122
123
# File 'lib/action_dispatch/http/response.rb', line 120

def initialize(response)
  @response = response
  @body = ""
end

Instance Method Details

#bust(body) ⇒ Object



125
126
127
128
129
# File 'lib/action_dispatch/http/response.rb', line 125

def bust(body)
  body.call(@response, self)
  body.close if body.respond_to?(:close)
  @body
end

#write(string) ⇒ Object



131
132
133
# File 'lib/action_dispatch/http/response.rb', line 131

def write(string)
  @body << string.to_s
end