Bread:...ection(3pm)
π Bread::Board::BlockInjection π
okay so bestie, welcome to the manual page for Bread::Board::BlockInjection, which lives in the 3pm section of the User Contributed Perl Documentation and is literally the vibe where your service gets built by a lil coderef you hand it. π
β¨ VERSION β¨
version 0.37 β that's the one, no cap. π¦
πΈ DESCRIPTION πΈ
So this service class does the whole instantiate-your-objects thing by calling a coderef that you supply in the block attribute. That's it, that's the whole personality. π«Ά
This class consumes these three roles:
Bread::Board::Service::WithClassBread::Board::Service::WithParametersBread::Board::Service::WithDependencies
Three roles, all slaying, all feeding into your service's whole thing. π
π§ ATTRIBUTES π§
π block
A coderef, and yes it's required β no block, no service, sorry bestie. π
Here's the cute part: it gets invoked as a method on the service object, which means inside it you can literally call $_[0]->params to get at your parameters and your (already resolved) dependencies. Iconic behaviour, honestly.
It should return an instance of class. That's the assignment. π
π class
This attribute comes to you courtesy of Bread::Board::Service::WithClass. If it's set, then block should return an instance of this class β and here's the lil bonus: the class will already be loaded, so there's no need to require it yourself. Saving you a whole line, you're welcome. β¨
π₯ METHODS π₯
π
has_class
Predicate for class. It's giving "do you even have a class, babe?" π
And if the service doesn't declare a class? Then block can of course return whatever it wants. Main character freedom. π
π
get
Calls the block as a method on the service, and returns whatever that returned. Simple as that. It's not that deep, and it ate. π
π AUTHOR π
Stevan Little <stevan@iinteractive.com> β the author, the legend, the blueprint. π
π¦ BUGS π¦
Please report any bugs or feature requests on the bugtracker website:
https://github.com/stevan/BreadBoard/issues
And when you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or the desired feature. Fr fr, it helps so much. π₯Ί
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive. That's a whole lot of years and we love that for them. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Periodt. β¨
okay and that's the whole page, bestie!! π This one's from perl v5.36.0, dated 2022-12-12, and it's the Bread:...ection(3pm) page β go forth and inject your blocks, you've got this. ππ¦πΈπ
π«Ά
π¦ 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