Class: ActionController::CgiResponse
- Inherits:
-
AbstractResponse
- Object
- AbstractResponse
- ActionController::CgiResponse
- Defined in:
- lib/action_controller/cgi_process.rb
Overview
:nodoc:
Constant Summary
Constants inherited from AbstractResponse
AbstractResponse::DEFAULT_HEADERS
Instance Attribute Summary
Attributes inherited from AbstractResponse
#assigns, #body, #cookies, #headers, #redirected_to, #redirected_to_method_params, #session, #template
Instance Method Summary collapse
-
#initialize(cgi) ⇒ CgiResponse
constructor
A new instance of CgiResponse.
- #out ⇒ Object
Methods inherited from AbstractResponse
Constructor Details
#initialize(cgi) ⇒ CgiResponse
Returns a new instance of CgiResponse.
104 105 106 107 |
# File 'lib/action_controller/cgi_process.rb', line 104 def initialize(cgi) @cgi = cgi super() end |
Instance Method Details
#out ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/action_controller/cgi_process.rb', line 109 def out convert_content_type!(@headers) $stdout.binmode if $stdout.respond_to?(:binmode) $stdout.sync = false print @cgi.header(@headers) if @cgi.send(:env_table)['REQUEST_METHOD'] == 'HEAD' return elsif @body.respond_to?(:call) @body.call(self) else print @body end end |