StructInspect.Opts (struct_inspect v0.1.4)
View SourceProvides a struct to configure the behavior of StructInspect.
Summary
Functions
Applies the given attributes to the default options.
Changes an existing StructInspect.Opts struct with new ommits.
Creates a new StructInspect.Opts struct.
Types
Functions
@spec apply_to_defaults(attributes()) :: t()
Applies the given attributes to the default options.
The default options are taken from the application environment.
Parameters
attrs(attributes()) - The attributes to apply. Defaults to[].
Returns
t() - A new StructInspect.Opts struct with the applied attributes.
@spec change(t(), attributes()) :: t()
Changes an existing StructInspect.Opts struct with new ommits.
Parameters
options(t()) - The options struct to change.ommits(attributes()) - The new ommits to apply.
Returns
t() - The modified StructInspect.Opts struct.
@spec new(attributes()) :: t()
Creates a new StructInspect.Opts struct.
It can receive:
- A map or keyword list of ommits to override the default values.
- A list of atoms, where only the named keys are set to
trueand the rest tofalse. - Another
StructInspect.Optsstruct, which is returned as is. - Nothing, in which case it returns the default struct.
Parameters
ommits(attributes()) - The ommits to create the struct. Defaults tonil.
Returns
t() - A new StructInspect.Opts struct.