Delx v2.1.1 Delx.Defdel View Source

A module defining a macro to define delegate functions.

Link to this section Summary

Functions

You can delegate functions calls to another module by using the Delx module and calling the defdel/2 macro in the module body. It has the same API as Elixir's own Kernel.defdelegate/2 macro.

Link to this section Functions

Link to this macro

defdel(funs, opts) View Source (macro)

You can delegate functions calls to another module by using the Delx module and calling the defdel/2 macro in the module body. It has the same API as Elixir's own Kernel.defdelegate/2 macro.

Example

Before calling defdel/2, you need to use Delx.

iex> defmodule Greeter do
...>   use Delx, otp_app: :greeter

...>   defdel hello(name), to: Greeter.StringGreeter, as: :welcome
...> end