interceptor v0.5.1 Interceptor.Annotated View Source

The Interceptor library allows you to intercept function calls, as you can see in the Interceptor module documentation.

This module allows you to intercept your functions using @intercept true “annotations”, instead of having to use the Interceptor.intercept/1 macro.

This is how you can use the Interceptor.Annotated module on the example Intercepted module (defined on the Interceptor module documentation):

defmodule Intercepted do
  use Interceptor.Annotated

  @intercept true
  def abc(x), do: "Got #{inspect(x)}"

  # the following function can't be intercepted
  # because it doesn't have the `@intercept true` annotation
  def not_intercepted(f, g, h), do: f+g+h
end

This way of intercepting the Intercepted.abc/1 function is equivalent to the one using the Interceptor.intercept/1 macro described on the Interceptor module documentation. Please check it for more information on how to configure this library.

Link to this section Summary

Link to this section Functions

Link to this macro before_compile(env) View Source (macro)
Link to this function on_definition(env, kind, fun, args, guards, body) View Source