Class: Shoulda::Matchers::Doublespeak::ProxyImplementation
- Inherits:
-
Object
- Object
- Shoulda::Matchers::Doublespeak::ProxyImplementation
- Extended by:
- Forwardable
- Defined in:
- lib/shoulda/matchers/doublespeak/proxy_implementation.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(call) ⇒ Object
-
#initialize(stub_implementation) ⇒ ProxyImplementation
constructor
A new instance of ProxyImplementation.
Constructor Details
#initialize(stub_implementation) ⇒ ProxyImplementation
Returns a new instance of ProxyImplementation.
16 17 18 |
# File 'lib/shoulda/matchers/doublespeak/proxy_implementation.rb', line 16 def initialize(stub_implementation) @stub_implementation = stub_implementation end |
Class Method Details
.create ⇒ Object
12 13 14 |
# File 'lib/shoulda/matchers/doublespeak/proxy_implementation.rb', line 12 def self.create new(StubImplementation.new) end |
Instance Method Details
#call(call) ⇒ Object
20 21 22 23 24 |
# File 'lib/shoulda/matchers/doublespeak/proxy_implementation.rb', line 20 def call(call) return_value = call.double.call_original_method(call) stub_implementation.call(call.with_return_value(return_value)) return_value end |