jgdv.structs.chainguard.mixins.proxy_m
Classes
A Mixin to add to GuardBase. |
Module Contents
- class jgdv.structs.chainguard.mixins.proxy_m.GuardProxyEntry_m[source]
A Mixin to add to GuardBase. enables handling a number of conditions when accessing values in the underlying data. eg: tg.on_fail(2, int).a.value() # either get a.value, or 2. whichever returns has to be an int.
- abstractmethod all_of(fallback, types=None) <Unknown>[source]
- Parameters:
fallback (Any)
types (jgdv.Maybe)
- Return type:
- abstractmethod first_of(fallback, types=None) <Unknown>[source]
get the first non-None value from a index path, even across arrays of tables so instead of: data.a.b.c[0].d just: data.first_of().a.b.c.d()
- Parameters:
fallback (Any)
types (jgdv.Maybe)
- Return type:
- abstractmethod flatten_on(fallback) <Unknown>[source]
combine all dicts at the call site to form a single dict
- Parameters:
fallback (Any)
- Return type: