Module: Rack::Response::Helpers

### Home Classes Methods

### In Files

- lib/rack/response.rb

### Methods

- #bad_request?
- #client_error?
- #content_length
- #content_type
- #forbidden?
- #include?
- #informational?
- #invalid?
- #location
- #method_not_allowed?
- #not_found?
- #ok?
- #redirect?
- #redirection?
- #server_error?
- #successful?
- #unprocessable?

### Files

- KNOWN-ISSUES

### Class/Module Index

Quicksearch

- Rack
- Rack::Auth
- Rack::Auth::AbstractHandler
- Rack::Auth::AbstractRequest
- Rack::Auth::Basic
- Rack::Auth::Basic::Request
- Rack::Auth::Digest
- Rack::Auth::Digest::MD5
- Rack::Auth::Digest::Nonce
- Rack::Auth::Digest::Params
- Rack::Auth::Digest::Request
- Rack::BodyProxy
- Rack::Builder
- Rack::Cascade
- Rack::Chunked
- Rack::Chunked::Body
- Rack::CommonLogger
- Rack::ConditionalGet
- Rack::Config
- Rack::ContentLength
- Rack::ContentType
- Rack::Deflater
- Rack::Deflater::DeflateStream
- Rack::Deflater::GzipStream
- Rack::Directory
- Rack::ETag
- Rack::File
- Rack::ForwardRequest
- Rack::Handler
- Rack::Handler::CGI
- Rack::Handler::EventedMongrel
- Rack::Handler::FastCGI
- Rack::Handler::LSWS
- Rack::Handler::Mongrel
- Rack::Handler::SCGI
- Rack::Handler::SwiftipliedMongrel
- Rack::Handler::Thin
- Rack::Handler::WEBrick
- Rack::Head
- Rack::Lint
- Rack::Lobster
- Rack::Lock
- Rack::Logger
- Rack::MethodOverride
- Rack::Mime
- Rack::MockRequest
- Rack::MockRequest::FatalWarner
- Rack::MockRequest::FatalWarning
- Rack::MockResponse
- Rack::Multipart
- Rack::Multipart::Generator
- Rack::Multipart::MultipartLimitError
- Rack::Multipart::Parser
- Rack::Multipart::UploadedFile
- Rack::NullLogger
- Rack::Recursive
- Rack::Reloader
- Rack::Reloader::Stat
- Rack::Request
- Rack::Response
- Rack::Response::Helpers
- Rack::RewindableInput
- Rack::RewindableInput::Tempfile
- Rack::Runtime
- Rack::Sendfile
- Rack::Server
- Rack::Server::Options
- Rack::Session
- Rack::Session::Abstract
- Rack::Session::Abstract::ID
- Rack::Session::Abstract::SessionHash
- Rack::Session::Cookie
- Rack::Session::Cookie::Base64
- Rack::Session::Cookie::Base64::Marshal
- Rack::Session::Cookie::Identity
- Rack::Session::Cookie::Reverse
- Rack::Session::Memcache
- Rack::Session::Pool
- Rack::ShowExceptions
- Rack::ShowStatus
- Rack::Static
- Rack::URLMap
- Rack::Utils
- Rack::Utils::Context
- Rack::Utils::HeaderHash
- Rack::Utils::KeySpaceConstrainedParams
- Rack::Utils::Multipart
- FCGI
- FCGI::Stream
- Object

No matching classes.

# Rack::Response::Helpers

### Attributes

headers[R]

Headers

original_headers[R]

Headers

### Public Instance Methods

bad_request?() click to toggle source

    # File lib/rack/response.rb, line 125
    def bad_request?;        status == 400;                        end

client_error?() click to toggle source

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

content_length() click to toggle source

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

content_type() click to toggle source

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

forbidden?() click to toggle source

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

include?(header) click to toggle source

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

informational?() click to toggle source

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

invalid?() click to toggle source

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

location() click to toggle source

    # File lib/rack/response.rb, line 149
    def location
      headers["Location"]
    end

method_not_allowed?() click to toggle source

    # File lib/rack/response.rb, line 128
    def method_not_allowed?; status == 405;                        end

not_found?() click to toggle source

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

ok?() click to toggle source

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

redirect?() click to toggle source

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

redirection?() click to toggle source

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

server_error?() click to toggle source

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

successful?() click to toggle source

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

unprocessable?() click to toggle source

    # File lib/rack/response.rb, line 129
    def unprocessable?;      status == 422;                        end

[Validate]

Generated with the Darkfish Rdoc Generator 2.