ExExport (ex_export v0.8.8)
View SourceThis module inspects another module for public functions and generates the defdelegate needed to add them to the local modules name space
Summary
Functions
require in the module and them call export for each module you want to import. The function list automatically filters out functions that start with an underscore
Functions
require in the module and them call export for each module you want to import. The function list automatically filters out functions that start with an underscore
## Examples defmodule Sample do
require ExExport
alias Sample.Actions.Greet
ExExport.export(Greet)
ExExport.export(Sample.Actions.Farewell)
end
Options
:only
- (since v0.2.0) a list of [function: arity] only matching functions will be delegated:exclude
- (since v0.2.0) a list of [function: arity] matching functions will NOT be delegated:expansion
- (since v.0.8.1) :manual or :macro -:macro - use Macro.expand. This seems to generate a compile time dependency :manual - uses custom code to figure out the alias resolution -which prevents the compile time dependency but can generate a **warning - alias is unused** because we are resolving it. You can get rid of the warning by changing to :macro, undoing the alias or adding warn: false to the alias
## See the Output
In the configuration file for the environment you wish to render the
data attributes, you can set the show_definitions
to true. This
will output the code that is being injected in a readable form. This can be useful
if you get warnings like (Cannot match because already defined)
config :ex_export, :show_definitions, true