Class: Rack::Auth::AbstractRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/auth/abstract/request.rb

Direct Known Subclasses

Basic::Request, Digest::Request

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ AbstractRequest

Returns a new instance of AbstractRequest.



7
8
9
# File 'lib/rack/auth/abstract/request.rb', line 7

def initialize(env)
  @env = env
end

Instance Method Details

#paramsObject



27
28
29
# File 'lib/rack/auth/abstract/request.rb', line 27

def params
  @params ||= parts.last
end

#partsObject



19
20
21
# File 'lib/rack/auth/abstract/request.rb', line 19

def parts
  @parts ||= @env[authorization_key].split(' ', 2)
end

#provided?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rack/auth/abstract/request.rb', line 15

def provided?
  !authorization_key.nil?
end

#requestObject



11
12
13
# File 'lib/rack/auth/abstract/request.rb', line 11

def request
  @request ||= Request.new(@env)
end

#schemeObject



23
24
25
# File 'lib/rack/auth/abstract/request.rb', line 23

def scheme
  @scheme ||= parts.first.downcase.to_sym
end