Class: Quarry::Mock::Delegator

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

Overview

Mock::Delegator

Instance Method Summary collapse

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