Class: Rack::Auth::Digest::Request
Instance Method Summary
collapse
#initialize, #parts, #provided?, #request, #scheme, #valid?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
33
34
35
36
37
|
# File 'lib/rack/auth/digest/request.rb', line 33
def method_missing(sym, *args)
return super unless params.has_key?(key = sym.to_s)
return params[key] if args.size == 0
raise ArgumentError, "wrong number of arguments (#{args.size} for 0)"
end
|
Instance Method Details
#correct_uri? ⇒ Boolean
17
18
19
|
# File 'lib/rack/auth/digest/request.rb', line 17
def correct_uri?
request.fullpath == uri
end
|
#digest? ⇒ Boolean
13
14
15
|
# File 'lib/rack/auth/digest/request.rb', line 13
def digest?
"digest" == scheme
end
|
#nonce ⇒ Object
21
22
23
|
# File 'lib/rack/auth/digest/request.rb', line 21
def nonce
@nonce ||= Nonce.parse(params['nonce'])
end
|
#params ⇒ Object
25
26
27
|
# File 'lib/rack/auth/digest/request.rb', line 25
def params
@params ||= Params.parse(parts.last)
end
|
#respond_to?(sym) ⇒ Boolean
29
30
31
|
# File 'lib/rack/auth/digest/request.rb', line 29
def respond_to?(sym, *)
super or params.has_key? sym.to_s
end
|