class Noder::HTTP::Response
Attributes
params[RW]
Public Class Methods
new(env)
click to toggle source
Calls superclass method
# File lib/noder/http/response.rb, line 6 def initialize(env) super(env[:connection]) @params = env[:request].params @is_rendered = false end
Public Instance Methods
end(content=nil)
click to toggle source
# File lib/noder/http/response.rb, line 42 def end(content=nil) return if @is_rendered @is_rendered = true write(content) if content send_response end
get_header(name)
click to toggle source
# File lib/noder/http/response.rb, line 34 def get_header(name) @headers[name] end
is_rendered?()
click to toggle source
# File lib/noder/http/response.rb, line 49 def is_rendered? @is_rendered end
remove_header(name)
click to toggle source
# File lib/noder/http/response.rb, line 38 def remove_header(name) @headers.delete(name) end
set_header(name, value)
click to toggle source
# File lib/noder/http/response.rb, line 30 def set_header(name, value) @headers[name] = value end
status_code()
click to toggle source
# File lib/noder/http/response.rb, line 26 def status_code self.status end
status_code=(status)
click to toggle source
# File lib/noder/http/response.rb, line 22 def status_code=(status) self.status = status end
write(content)
click to toggle source
# File lib/noder/http/response.rb, line 12 def write(content) self.content ||= '' self.content << content end
write_head(status, headers={})
click to toggle source
# File lib/noder/http/response.rb, line 17 def write_head(status, headers={}) self.status = status @headers.merge!(headers) end
Protected Instance Methods
app()
click to toggle source
# File lib/noder/http/response.rb, line 55 def app @delegate.app end
request_env()
click to toggle source
# File lib/noder/http/response.rb, line 59 def request_env @delegate.request_env end