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 138
138:       def client_error?;  @status >= 400 && @status < 500;       end

[Source]

     # File lib/rack/response.rb, line 159
159:       def content_length
160:         cl = headers["Content-Length"]
161:         cl ? cl.to_i : cl
162:       end

[Source]

     # File lib/rack/response.rb, line 155
155:       def content_type
156:         headers["Content-Type"]
157:       end

[Source]

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

[Source]

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

[Source]

     # File lib/rack/response.rb, line 151
151:       def include?(header)
152:         !!headers[header]
153:       end

[Source]

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

[Source]

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

[Source]

     # File lib/rack/response.rb, line 164
164:       def location
165:         headers["Location"]
166:       end

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Source]

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

[Validate]