Class: Rack::Test::MockDigestRequest
- Inherits:
-
Object
- Object
- Rack::Test::MockDigestRequest
- Defined in:
- lib/rack/test/mock_digest_request.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(params) ⇒ MockDigestRequest
constructor
A new instance of MockDigestRequest.
- #method ⇒ Object
- #method_missing(sym) ⇒ Object
- #response(password) ⇒ Object
Constructor Details
#initialize(params) ⇒ MockDigestRequest
Returns a new instance of MockDigestRequest.
6 7 8 |
# File 'lib/rack/test/mock_digest_request.rb', line 6 def initialize(params) @params = params end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rack/test/mock_digest_request.rb', line 10 def method_missing(sym) if @params.has_key? k = sym.to_s return @params[k] end super end |
Instance Method Details
#method ⇒ Object
18 19 20 |
# File 'lib/rack/test/mock_digest_request.rb', line 18 def method @params['method'] end |
#response(password) ⇒ Object
22 23 24 |
# File 'lib/rack/test/mock_digest_request.rb', line 22 def response(password) Rack::Auth::Digest::MD5.new(nil).send :digest, self, password end |