Bunch v0.1.1 Bunch.Module View Source
A bunch of functions for easier manipulation on modules.
Link to this section Summary
Functions
Determines whether module implements a behaviour by checking a test function
Ensures that module is loaded and checks whether it exports given function
Returns instance of struct defined in given module, if the module defines struct.
Otherwise returns nil
Link to this section Functions
Determines whether module implements a behaviour by checking a test function.
Checked behaviour needs to define a callback with unique name and no arguments,
that should return true
. This functions ensures that the module is loaded and
checks if it exports implementation of the callback that returns true
. If
all these conditions are met, true
is returned. Otherwise returns false
.
loaded_and_function_exported?(module(), atom(), non_neg_integer()) :: boolean()
Ensures that module is loaded and checks whether it exports given function.
Returns instance of struct defined in given module, if the module defines struct.
Otherwise returns nil
.
Raises if struct has any required fields.