class Rack::Auth::AbstractRequest - rack-1.6.2 Documentation

# class Rack::Auth::AbstractRequest

### Constants

AUTHORIZATION_KEYS

### Public Class Methods

new(env) click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 7
    def initialize(env)
      @env = env
    end

### Public Instance Methods

params() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 27
    def params
      @params ||= parts.last
    end

parts() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 19
    def parts
      @parts ||= @env[authorization_key].split(' ', 2)
    end

provided?() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 15
    def provided?
      !authorization_key.nil?
    end

request() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 11
    def request
      @request ||= Request.new(@env)
    end

scheme() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 23
    def scheme
      @scheme ||= parts.first && parts.first.downcase
    end

### Private Instance Methods

authorization_key() click to toggle source

    # File lib/rack/auth/abstract/request.rb, line 36
    def authorization_key
      @authorization_key ||= AUTHORIZATION_KEYS.detect { |key| @env.has_key?(key) }
    end