Class: XSpec::Evaluator::Doubles::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/xspec/evaluators.rb
Overview
The proxy object captures messages sent to it and passes them through to either the ‘_verify` of `_stub` method on the double.
Instance Method Summary collapse
-
#initialize(double, method) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(*args, &ret) ⇒ Object
Constructor Details
#initialize(double, method) ⇒ Proxy
Returns a new instance of Proxy.
175 176 177 178 |
# File 'lib/xspec/evaluators.rb', line 175 def initialize(double, method) @double = double @method = method end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &ret) ⇒ Object
180 181 182 |
# File 'lib/xspec/evaluators.rb', line 180 def method_missing(*args, &ret) @double.__send__(@method, args, &(ret || ->{})) end |