Bread:...::Types(3pm)
π Bread::Board::Types β the vibe check β¨
okay so bestie, you found the manual page for Bread::Board::Types, which lives in the Bread:...::Types(3pm) corner of the User Contributed Perl Documentation universe. it's giving types and coercions for Bread::Board energy, and honestly? it ate. let's get into it π«Ά
πΈ NAME πΈ
Bread::Board::Types β types and coercions for Bread::Board. that's the whole name, no notes π
β¨ VERSION β¨
version 0.37 β yes queen, that's the one π
π¦ DESCRIPTION π¦
so like, this package defines types and coercions for Bread::Board. that's it. that's the description. short and iconic, periodt π
π TYPES π
π "Bread::Board::Container::SubContainerList"
a hashref mapping strings to instances of Bread::Board::Container or Bread::Board::Container::Parameterized. like a lil directory of containers, no cap.
can be coerced from an arrayref of containers β and the keys will be the containers' names. slay β¨
π "Bread::Board::Container::ServiceList"
a hashref mapping strings to instances of Bread::Board::Service. a whole roster of services, main character energy fr fr.
can be coerced from an arrayref of services β the keys will be the services' names. obsessed π
π§ "Bread::Board::Service::Dependencies"
hashref mapping strings to instances of Bread::Board::Dependency. and here's where it gets interesting, bestie β the values of the hashref can be coerced in several different ways:
- a string β will be interpreted as the
"service_path" - a hashref with a single key β the key will be interpreted as a
"service_path", and the value as a hashref for"service_params" - an arrayref β each element will be interpreted as a dependency (possibly through all the coercions listed here); see below for an example
- a service object β will be interpreted as a dependency on that service
- a dependency object β will be taken as-is
and instead of a hashref of any of the above things, you can use an arrayref: it will be coerced to hashref, using the (coerced) dependencies' names as keys. cute right? π
πΈ Examples πΈ
service foo => (
class => 'Foo',
dependencies => {
{ bar => { attribute => 12 } },
},
);
so the service "foo" depends on the parameterized service "bar", and "bar" will be instantiated passing the hashref "{ attribute => 12 }" to its "get" method. iconic behaviour honestly.
service foo => (
class => 'Foo',
dependencies => {
things => [ 'bar', 'baz' ],
},
);
here the service "foo" depends on the services "bar" and "baz", and when instantiating "foo", its constructor will receive something like "things => [ $instance_of_bar, $instance_of_baz ]". chef's kiss π
service foo => (
class => 'Foo',
dependencies => {
things => [
{ bar => { attribute => 12 } },
{ bar => { attribute => 27 } },
],
},
);
you can mix & match the coercions! this "foo" will get two different instances of "bar" in its "things" attribute, each "bar" instantiated with a different value. the way that just works? π₯
β "Bread::Board::Service::Parameters"
hashref mapping strings to MooseX::Params::Validate specifications.
can be coerced from an arrayref of strings, so like:
[qw(a b c)]
becomes:
{
a => { optional => 0 },
b => { optional => 0 },
c => { optional => 0 },
}
look at that glow-up π β¨
π AUTHOR π
Stevan Little <stevan@iinteractive.com> β the icon, the moment, the legend π
π BUGS π
please report any bugs or feature requests on the bugtracker website:
https://github.com/stevan/BreadBoard/issues
and 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. this is not optional bestie, it's the vibe π
π 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. π«Ά
okay and that's a wrap on the Bread:...::Types(3pm) page, babes. this was rendered by perl v5.36.0 on 2022-12-12 β so like, remember that date when you cite it, k? mwah π
π¦ 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