Class: Rack::Auth::AbstractRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/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/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 7

def initialize(env)
  @env = env
end

Instance Method Details

#paramsObject



31
32
33
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 31

def params
  @params ||= parts.last
end

#partsObject



23
24
25
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 23

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

#provided?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 15

def provided?
  !authorization_key.nil? && valid?
end

#requestObject



11
12
13
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 11

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

#schemeObject



27
28
29
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 27

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

#valid?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rack-2.2.5/lib/rack/auth/abstract/request.rb', line 19

def valid?
  !@env[authorization_key].nil?
end