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.



5
6
7
# File 'lib/rack/auth/abstract/request.rb', line 5

def initialize(env)
  @env = env
end

Instance Method Details

#paramsObject



21
22
23
# File 'lib/rack/auth/abstract/request.rb', line 21

def params
  @params ||= parts.last
end

#partsObject



13
14
15
# File 'lib/rack/auth/abstract/request.rb', line 13

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

#provided?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/rack/auth/abstract/request.rb', line 9

def provided?
  !authorization_key.nil?
end

#schemeObject



17
18
19
# File 'lib/rack/auth/abstract/request.rb', line 17

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