Bread:...ection(3pm)

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

πŸ’– 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::WithClass
  • Bread::Board::Service::WithParameters
  • Bread::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. πŸ₯Ί

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