Bread:...erized(3pm)
π Bread:...erized(3pm) π
okay so bestie, welcome to the User Contributed Perl Documentation section, and this particular page is all about Bread::Board::Container::Parameterized β a parameterized container, no cap π«Ά
β¨ NAME β¨
Bread::Board::Container::Parameterized β a parameterized container π
πΈ VERSION πΈ
version 0.37 β yeah she's on 0.37, iconic, we love a numbered queen β¨
π¦ DESCRIPTION π¦
So basically this class implements a sort of container factory for Bread::Board, which is giving very much "build me a thing that builds things" energy π
A parameterized container is, in practice, a function from a set of parameters (and those parameters must be containers, periodt) to an actual container π«
If you want to see this in action, go look at Bread::Board::Manual::Example::FormSensible β there's an example there fr fr π
π ATTRIBUTES π
name
Read/write string, required. Every container needs a name, because that's how you reference it when you're fetching it π·οΈ Like, she needs a name to be called, obviously π
allowed_parameter_names
Read-only arrayref of strings, required. These are the names of the containers that must be passed to create to actually get a real container out of this parameterized object β no substitutions, no extras, we're strict here bestie πβ¨
container
This attribute holds the "prototype" container π§ Services inside it can depend on service paths that include the container names given in allowed_parameter_names π
π METHODS π
add_service, get_service, has_service, get_service_list, has_services, add_sub_container, get_sub_container, has_sub_container, get_sub_container_list, has_sub_containers
All these methods are delegated to the prototype container, so that this object can be defined as if it were a normal container π The way that delegation just makes everything work is so satisfying, honestly π«Ά
create
my $container = $parameterized_container->create(%params);
After checking that the keys of %params are exactly the same strings that are present in allowed_parameter_names, this method:
- clones the prototype
container𧬠- adds the
%paramsto the clone as sub-containers - returns the clone π
If this was not a top-level container, the parent is also cloned, and the container clone gets added to the parent clone β the whole family tree gets duplicated, lowkey dramatic but it's what she does π³π«
β οΈ Please note, bestie: the container returned by this method does not have the same name as the parameterized container. And calling this method with different parameter values will return different containers β but all with the same name. It's probably a bad idea to instantiate a non-top-level parameterized container more than once. Like, don't do it. I'm serious ππ
fetch, resolve
These two methods die π because services in a parameterized container won't usually resolve, and attempting to do so is almost always a mistake π So like, don't try it, she will end you, respectfully π
π AUTHOR π
Stevan Little <stevan@iinteractive.com> β thank you for your service, king π«‘β¨
π BUGS π
Please report any bugs or feature requests on the bugtracker website:
https://github.com/stevan/BreadBoard/issues
When 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, help them help you, bestie, it's giving teamwork π
π COPYRIGHT AND LICENSE π
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 β¨ β yeah she's free, she's open, she's generous, we stan π
and that's the whole page bestie!! π this doc came to you courtesy of perl v5.36.0 and it was dated 2022-12-12, mwah, bye!! ππ¦π
π¦ where this page comes from
- debian bookworm: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libbread-board-perl 0.37-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms