View Source Routex.ExtensionUtils (Phoenix Routes Extension Framework v0.1.0-alpha.6)

Provides utility funtions for extension development.

Link to this section Summary

Functions

Macro.escape/1 and IO.inspect/2 the given input. Options are passed through to IO.inspect. Returns the input.

Returns the ast to get the last value in the order list

Helper function to inspect AST as formatted code. Returns the input.

Link to this section Functions

Link to this function

esc_inspect(ast, opts \\ [])

View Source

Macro.escape/1 and IO.inspect/2 the given input. Options are passed through to IO.inspect. Returns the input.

@spec get_helper_ast(caller :: Macro.Env.t()) :: Macro.output()

Returns the ast to get the last value in the order list

Link to this function

inspect_ast(ast, env \\ __ENV__)

View Source

Helper function to inspect AST as formatted code. Returns the input.

Example

iex> ast = quote do: Map.put(my_map, :key, value)
iex> inspect_ast(ast)
Map.put(my_map, :key, value)
...actual AST...