Class: ActionDispatch::Response::BodyBuster

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ BodyBuster

Returns a new instance of BodyBuster.



119
120
121
122
# File 'actionpack/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 'actionpack/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 'actionpack/lib/action_dispatch/http/response.rb', line 130

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