Class: Lookout::Recorders::Reception::Method

Inherits:
Aphonic show all
Defined in:
lib/lookout/recorders/reception.rb

Constant Summary

Constants inherited from Aphonic

Aphonic::Methods

Instance Method Summary collapse

Methods inherited from Aphonic

silence

Constructor Details

#initialize(recorder, negated) ⇒ Method

Returns a new instance of Method.



34
35
36
# File 'lib/lookout/recorders/reception.rb', line 34

def initialize(recorder, negated)
  @recorder, @negated = recorder, negated
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &body) ⇒ Object



38
39
40
41
# File 'lib/lookout/recorders/reception.rb', line 38

def method_missing(method, *args, &body)
  @method, @args, @body = method, args, body
  @recorder
end

Instance Method Details

#_lookout_define(mocks) ⇒ Object



43
44
45
# File 'lib/lookout/recorders/reception.rb', line 43

def _lookout_define(mocks)
  mocks.define(@recorder.subject, @method, *@args, &@body).tap{ |m| m.never if @negated }
end