Class: Needle::Interceptor::DynamicInterceptor

Class | Needle::Interceptor::DynamicInterceptor
In: | lib/needle/interceptor.rb
Parent: | Object

This is the wrapper for on-the-fly interceptors that have been created via Interceptor#doing. The callback registered with Interceptor#doing gets wrapped by an instance of this class, to comply with the interface required by InterceptorChainBuilder.

This class should rarely (if ever) be instantiated directly. Instead, using the Interceptor#doing method to create dynamic interceptors.

### Methods

new new process

### Public Class methods

new( callback )

Create a new DynamicInterceptor instance that wraps the given callback.

### Public Instance methods

new( point, opts )

This method is a concession to the required interceptor factory interface. It should return the new interceptor, configured to be attached to the given service point, and with the given options. It will always return `self`.

process( chain, context )

Process this link in the interceptor chain. This will invoke the wrapped callback, passing in the chain and context parameters. Before invoking the callback, the options and service point references that were given in new are assigned to context data members (so they can be referenced inside the callback).

[Validate]