Module.definitions_in

You're seeing just the function definitions_in, go back to Module module for more information.

Specs

definitions_in(module()) :: [definition()]

Returns all functions and macros defined in module.

It returns a list with all defined functions and macros, public and private, in the shape of [{name, arity}, ...].

This function can only be used on modules that have not yet been compiled. Use the Module.__info__/1 callback to get the public functions and macros in compiled modules.

Examples

defmodule Example do
  def version, do: 1
  defmacrop test(arg), do: arg
  Module.definitions_in(__MODULE__) #=> [{:version, 0}, {:test, 1}]
end
Link to this function

definitions_in(module, kind)

View Source

Specs

definitions_in(module(), def_kind()) :: [definition()]

Returns all functions defined in module, according to its kind.

This function can only be used on modules that have not yet been compiled. Use the Module.__info__/1 callback to get the public functions and macros in compiled modules.

Examples

defmodule Example do
  def version, do: 1
  Module.definitions_in(__MODULE__, :def)  #=> [{:version, 0}]
  Module.definitions_in(__MODULE__, :defp) #=> []
end