Class: Rack::Auth::AbstractRequest
- Inherits:
-
Object
- Object
- Rack::Auth::AbstractRequest
- Defined in:
- lib/rack/auth/abstract/request.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(env) ⇒ AbstractRequest
constructor
A new instance of AbstractRequest.
- #params ⇒ Object
- #parts ⇒ Object
- #provided? ⇒ Boolean
- #request ⇒ Object
- #scheme ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(env) ⇒ AbstractRequest
Returns a new instance of AbstractRequest.
10 11 12 |
# File 'lib/rack/auth/abstract/request.rb', line 10 def initialize(env) @env = env end |
Instance Method Details
#params ⇒ Object
35 36 37 |
# File 'lib/rack/auth/abstract/request.rb', line 35 def params @params ||= parts.last end |
#parts ⇒ Object
27 28 29 |
# File 'lib/rack/auth/abstract/request.rb', line 27 def parts @parts ||= @env[].split(' ', 2) end |
#provided? ⇒ Boolean
19 20 21 |
# File 'lib/rack/auth/abstract/request.rb', line 19 def provided? !.nil? && valid? end |
#request ⇒ Object
14 15 16 17 |
# File 'lib/rack/auth/abstract/request.rb', line 14 def request warn "Rack::Auth::AbstractRequest#request is deprecated and will be removed in a future version of rack.", uplevel: 1 @request ||= Request.new(@env) end |
#scheme ⇒ Object
31 32 33 |
# File 'lib/rack/auth/abstract/request.rb', line 31 def scheme @scheme ||= parts.first&.downcase end |
#valid? ⇒ Boolean
23 24 25 |
# File 'lib/rack/auth/abstract/request.rb', line 23 def valid? !@env[].nil? end |