Class: SonarSession::MockDigestRequest
- Inherits:
-
Object
- Object
- SonarSession::MockDigestRequest
- Defined in:
- lib/sonar/session.rb
Overview
stolen from rack-test
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.
128 129 130 |
# File 'lib/sonar/session.rb', line 128 def initialize(params) @params = params end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/sonar/session.rb', line 132 def method_missing(sym) if @params.has_key? k = sym.to_s return @params[k] end super end |
Instance Method Details
#method ⇒ Object
140 141 142 |
# File 'lib/sonar/session.rb', line 140 def method @params['method'] end |
#response(password) ⇒ Object
144 145 146 |
# File 'lib/sonar/session.rb', line 144 def response(password) Rack::Auth::Digest::MD5.new(nil).send :digest, self, password end |