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