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.
9 10 11 |
# File 'lib/rack/auth/abstract/request.rb', line 9 def initialize(env) @env = env end |
Instance Method Details
#params ⇒ Object
33 34 35 |
# File 'lib/rack/auth/abstract/request.rb', line 33 def params @params ||= parts.last end |
#parts ⇒ Object
25 26 27 |
# File 'lib/rack/auth/abstract/request.rb', line 25 def parts @parts ||= @env[].split(' ', 2) end |
#provided? ⇒ Boolean
17 18 19 |
# File 'lib/rack/auth/abstract/request.rb', line 17 def provided? !.nil? && valid? end |
#request ⇒ Object
13 14 15 |
# File 'lib/rack/auth/abstract/request.rb', line 13 def request @request ||= Request.new(@env) end |
#scheme ⇒ Object
29 30 31 |
# File 'lib/rack/auth/abstract/request.rb', line 29 def scheme @scheme ||= parts.first&.downcase end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/rack/auth/abstract/request.rb', line 21 def valid? !@env[].nil? end |