Methods
A
B
C
D
E
F
I
L
M
N
O
P
R
S
U
Instance Public methods
accepted?()
# File lib/rack/response.rb, line 121
def accepted?;            status == 202;                        end
add_header(key, v)

Add a header that may have multiple values.

Example:

response.add_header 'Vary', 'Accept-Encoding'
response.add_header 'Vary', 'Cookie'

assert_equal 'Accept-Encoding,Cookie', response.get_header('Vary')

www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2

# File lib/rack/response.rb, line 147
def add_header key, v
  if v.nil?
    get_header key
  elsif has_header? key
    set_header key, "#{get_header key},#{v}"
  else
    set_header key, v
  end
end
bad_request?()
# File lib/rack/response.rb, line 124
def bad_request?;         status == 400;                        end
cache_control()
# File lib/rack/response.rb, line 199
def cache_control
  get_header CACHE_CONTROL
end
cache_control=(v)
# File lib/rack/response.rb, line 203
def cache_control= v
  set_header CACHE_CONTROL, v
end
client_error?()
# File lib/rack/response.rb, line 116
def client_error?;        status >= 400 && status < 500;        end
content_length()
# File lib/rack/response.rb, line 169
def content_length
  cl = get_header CONTENT_LENGTH
  cl ? cl.to_i : cl
end
content_type()
# File lib/rack/response.rb, line 157
def content_type
  get_header CONTENT_TYPE
end
created?()
# File lib/rack/response.rb, line 120
def created?;             status == 201;                        end
etag()
# File lib/rack/response.rb, line 207
def etag
  get_header ETAG
end
etag=(v)
# File lib/rack/response.rb, line 211
def etag= v
  set_header ETAG, v
end
forbidden?()
# File lib/rack/response.rb, line 126
def forbidden?;           status == 403;                        end
include?(header)
# File lib/rack/response.rb, line 134
def include?(header)
  has_header? header
end
informational?()
# File lib/rack/response.rb, line 113
def informational?;       status >= 100 && status < 200;        end
invalid?()
# File lib/rack/response.rb, line 111
def invalid?;             status < 100 || status >= 600;        end
location()
# File lib/rack/response.rb, line 174
def location
  get_header "Location"
end
location=(location)
# File lib/rack/response.rb, line 178
def location=(location)
  set_header "Location", location
end
media_type()
# File lib/rack/response.rb, line 161
def media_type
  MediaType.type(content_type)
end
media_type_params()
# File lib/rack/response.rb, line 165
def media_type_params
  MediaType.params(content_type)
end
method_not_allowed?()
# File lib/rack/response.rb, line 128
def method_not_allowed?;  status == 405;                        end
moved_permanently?()
# File lib/rack/response.rb, line 123
def moved_permanently?;   status == 301;                        end
no_content?()
# File lib/rack/response.rb, line 122
def no_content?;          status == 204;                        end
not_found?()
# File lib/rack/response.rb, line 127
def not_found?;           status == 404;                        end
ok?()
# File lib/rack/response.rb, line 119
def ok?;                  status == 200;                        end
precondition_failed?()
# File lib/rack/response.rb, line 129
def precondition_failed?; status == 412;                        end
redirect?()
# File lib/rack/response.rb, line 132
def redirect?;            [301, 302, 303, 307, 308].include? status; end
redirection?()
# File lib/rack/response.rb, line 115
def redirection?;         status >= 300 && status < 400;        end
server_error?()
# File lib/rack/response.rb, line 117
def server_error?;        status >= 500 && status < 600;        end
successful?()
# File lib/rack/response.rb, line 114
def successful?;          status >= 200 && status < 300;        end
unauthorized?()
# File lib/rack/response.rb, line 125
def unauthorized?;        status == 401;                        end
unprocessable?()
# File lib/rack/response.rb, line 130
def unprocessable?;       status == 422;                        end