transform

pyrubrum.transform(menus: Union[Dict[pyrubrum.menus.base_menu.BaseMenu, Any], Iterable[pyrubrum.menus.base_menu.BaseMenu]]) → Set[pyrubrum.tree.node.Node]

Transform an iterable compounded of menus into a Node object. If a dictionary is provided as argument, its values will be transformed as well and added as children using recursive_add.

Parameters

menus (Union[Dict[BaseMenu, Any], Iterable[BaseMenu]]) – The iterable whose elements are BaseMenu instances.

Returns

The Node object which collects all the menus as children.

Return type

Node