Class: Quarry::Stub::Delegator

Inherits:
Object
  • Object
show all
Defined in:
lib/quarry/stub.rb

Overview

Stub::Delegator

Instance Method Summary collapse

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