Class Waves::Response
In: lib/runtime/response.rb
Parent: Object

Waves::Response represents an HTTP response and has methods for constructing a response. These include setters for content_type, content_length, location, and expires headers. You may also set the headers directly using the [] operator. See Rack::Response for documentation of any method not defined here.

Methods

Attributes

request  [R] 

Public Class methods

Create a new response. Takes the request object. You shouldn‘t need to call this directly.

[Source]

    # File lib/runtime/response.rb, line 13
13:     def initialize( request )
14:       @request = request
15:       @response = Rack::Response.new
16:     end

Public Instance methods

Finish the response. This will send the response back to the client, so you shouldn‘t attempt to further modify the response once this method is called. You don‘t usually need to call it yourself, since it is called by the dispatcher once request processing is finished.

[Source]

    # File lib/runtime/response.rb, line 34
34:     def finish ;  @response.finish ; end

Methods not explicitly defined by Waves::Response are delegated to Rack::Response. Check the Rack documentation for more informations

[Source]

    # File lib/runtime/response.rb, line 38
38:     def method_missing(name,*args)
39:       @response.send(name,*args)
40:     end

[Source]

    # File lib/runtime/response.rb, line 18
18:     def rack_response; @response; end

Returns the sessions associated with the request, allowing you to set values within it. The session will be created if necessary and saved when the response is complete.

[Source]

    # File lib/runtime/response.rb, line 28
28:     def session ; request.session ; end

[Validate]