Bread:...ersable(3pm)

πŸ“¦
version 0.37 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

✨ NAME ✨

okay so this is Bread::Board::Traversable β€” it's a role for traversing a container service tree πŸ’– (and yes bestie, it lives in the User Contributed Perl Documentation corner of the 3pm manuals, we're fancy like that)


🌸 VERSION 🌸

version 0.37 πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

my $service = $container->fetch('/some/service/path');

my $root = $service->get_root_container;

like. that's it. that's the whole vibe check. ✨


πŸ’… DESCRIPTION πŸ’…

so this role hands you the basic functionality to traverse a container / service tree. the tea is: any class that consumes this role gets a whole parent-child relationship between instances. it's giving family tree but make it services πŸŒ³πŸ’–


πŸŽ€ ATTRIBUTES πŸŽ€

parent

a weak ref to another Bread::Board::Traversable object. it's a read/write accessor, okay, but you should probably not change this value directly in normal code πŸ™ˆ like it's there, it works, but pls don't.


⭐ METHODS ⭐

has_parent

predicate for the parent attribute πŸ’« true if a parent has been set. basically "do i have a mother" but for objects.

detach_from_parent

clearer for the parent attribute. you should probably not call this method in normal code 😭 it's giving "i'm emancipating myself" energy but pls don't actually.

get_root_container

returns the farthest ancestor of the invocant β€” aka the top-most container this object is a part of πŸ‘‘ main character at the very top of the tree, no cap.

fetch

my $service = $this->fetch('/absolute/path');
my $service = $this->fetch('relative/path');
my $service = $this->fetch('../relative/path');

give it a (relative or absolute) path to a service or container and this method walks the tree and returns the Bread::Board::Service or Bread::Board::Container instance for that path. πŸšΆβ™€οΈπŸŒ³

heads up bestie: it dies if no object can be found for the given path πŸ’€ no object, no service, no mercy.

also, aliases are resolved in this call, by calling "aliased_from" until we get an actual service. iconic behaviour honestly, it keeps going till it finds the real one 🫢


πŸ’œ AUTHOR πŸ’œ

Stevan Little <stevan@iinteractive.com> β€” yes the legend himself, we stan 🧚


🌈 BUGS 🌈

pls report any bugs or feature requests on the bugtracker website:

https://github.com/stevan/BreadBoard/issues

and when you're submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature πŸ“ like give us the receipts, fr fr.


This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay πŸ’…


and that's the whole page bestie!! this lil manual came to you courtesy of perl v5.36.0, dated 2022-12-12 πŸŒΈπŸ¦‹πŸ’– go forth and traverse that tree, you absolute icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from