Class: Quarry::Mock::Delegator
Overview
Mock::Delegator
Instance Method Summary collapse
-
#initialize(object, mock_module) ⇒ Delegator
constructor
A new instance of Delegator.
- #method_missing(s, *a, &b) ⇒ Object
Constructor Details
#initialize(object, mock_module) ⇒ Delegator
Returns a new instance of Delegator.
49 50 51 52 |
# File 'lib/quarry/mock.rb', line 49 def initialize(object, mock_module) @instance_delegate = object extend(mock_module) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(s, *a, &b) ⇒ Object
54 55 56 |
# File 'lib/quarry/mock.rb', line 54 def method_missing(s, *a, &b) @instance_delegate.__send__(s, *a, &b) end |