init_decorator()¶
- audobject.init_decorator(*, borrow=None, hide=None, resolvers=None)[source]¶
Decorator for
__init__
function ofaudobject.Object
.If your class expects an argument
a
which is passed on as an argument to a classC
or to a dictionary with keya
, and stored underself.b
, you can borrow the argument fromb
by settingborrow = {'a': 'b'}
. This will storea
in the YAML representation, even though your class actually does not have a corresponding attributeself.a
.Arguments listed in
hidden
are not serialized to YAML. Note that objects you borrow attributes from, are also treated as hidden arguments.If a dictionary of
audobject.ValueResolver
is passed, matching attributes will be encoded / decoded using the accordingaudobject.ValueResolver
.