Class: Lookout::Object::To::Receive

Inherits:
Aphonic show all
Defined in:
lib/lookout-3.0/object/to/receive.rb

Overview

The “to receive” keywords on Objects.

Constant Summary

Constants inherited from Aphonic

Aphonic::Methods

Instance Method Summary collapse

Methods inherited from Aphonic

silence

Constructor Details

#initialize(object) ⇒ Receive

Stands in for OBJECT, allowing a Reception exception that expects the given method to be called to be set up.

Parameters:



8
# File 'lib/lookout-3.0/object/to/receive.rb', line 8

def initialize(object) @object = object end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &body) ⇒ Reception (private)

Returns A method reception expectation on the subject for METHOD with args, using body as the method definition.

Returns:

  • (Reception)

    A method reception expectation on the subject for METHOD with args, using body as the method definition



15
16
17
# File 'lib/lookout-3.0/object/to/receive.rb', line 15

def method_missing(method, *args, &body)
  Lookout::Reception.of(@object, method, *args, &body)
end