Module Rack::Response::Helpers
In: lib/rack/response.rb

Methods

Attributes

headers  [R]  Headers
original_headers  [R]  Headers

Public Instance methods

[Source]

     # File lib/rack/response.rb, line 133
133:       def client_error?;  @status >= 400 && @status < 500;       end

[Source]

     # File lib/rack/response.rb, line 154
154:       def content_length
155:         cl = headers["Content-Length"]
156:         cl ? cl.to_i : cl
157:       end

[Source]

     # File lib/rack/response.rb, line 150
150:       def content_type
151:         headers["Content-Type"]
152:       end

[Source]

     # File lib/rack/response.rb, line 141
141:       def empty?;         [201, 204, 304].include?      @status; end

[Source]

     # File lib/rack/response.rb, line 137
137:       def forbidden?;     @status == 403;                        end

[Source]

     # File lib/rack/response.rb, line 146
146:       def include?(header)
147:         !!headers[header]
148:       end

[Source]

     # File lib/rack/response.rb, line 130
130:       def informational?; @status >= 100 && @status < 200;       end

[Source]

     # File lib/rack/response.rb, line 128
128:       def invalid?;       @status < 100 || @status >= 600;       end

[Source]

     # File lib/rack/response.rb, line 159
159:       def location
160:         headers["Location"]
161:       end

[Source]

     # File lib/rack/response.rb, line 138
138:       def not_found?;     @status == 404;                        end

[Source]

     # File lib/rack/response.rb, line 136
136:       def ok?;            @status == 200;                        end

[Source]

     # File lib/rack/response.rb, line 140
140:       def redirect?;      [301, 302, 303, 307].include? @status; end

[Source]

     # File lib/rack/response.rb, line 132
132:       def redirection?;   @status >= 300 && @status < 400;       end

[Source]

     # File lib/rack/response.rb, line 134
134:       def server_error?;  @status >= 500 && @status < 600;       end

[Source]

     # File lib/rack/response.rb, line 131
131:       def successful?;    @status >= 200 && @status < 300;       end

[Validate]