Bread:...ection(3pm)
π NAME π
Bread::Board::ConstructorInjection β the service that makes objects by yelling at a constructor. it's giving "i don't build the thing, i just call the thing that builds the thing." β¨
so this is a Perl module, manual section 3pm, and it lives in the User Contributed Perl Documentation corner of the world. welcome bestie, come sit with me π«Ά
πΈ VERSION πΈ
version 0.37 β that's the one, no cap π
π DESCRIPTION π
okay so real talk: this service class instantiates objects by calling the constructor on a class. that's literally the whole job. you hand it a class, it calls the constructor, boom, you have an object. iconic behavior honestly π
and the way it does this? it consumes these three roles, like it's wearing three absolutely essential accessories:
Bread::Board::Service::WithClassBread::Board::Service::WithParametersBread::Board::Service::WithDependencies
all three. every time. it's a whole look and it's not negotiable π
β¨ ATTRIBUTES β¨
π class
this attribute is provided by Bread::Board::Service::WithClass, but here's the tea: this service makes it a required attribute.
like, obviously?? you can't call a constructor if you don't have a class. that's not a vibe, that's just physics. so if you're out here trying to run this without a class, bestie, no. π«
π constructor_name
optional string, okay? it indicates the name of the class method to invoke to construct the object. that's the whole assignment.
now β if you don't provide it, it defaults to the constructor name obtained via Class::MOP::Class. and if introspection does not work? it falls back to "new". so either way you're covered, she always has a backup plan π¦
π METHODS π
β get
this is the main character method. what it does:
- calls the constructor (as indicated by
constructor_name) on theclass - passes all the service parameters as a hash
- returns whatever the constructor returned
and listen, the "hopefully" is doing a lot of heavy lifting there β the docs say it returns whatever the constructor returned, hopefully a correctly-constructed object of the right class. so like, it's gonna give you back whatever came out. if your constructor is a mess, that's between you and your constructor. not her problem π
π AUTHOR π
Stevan Little <stevan@iinteractive.com> β the author, the legend, the moment π«Ά
π BUGS π
found a bug? want a feature? 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 desired feature. fr fr β a repro is the love language of maintainers π
π 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. slay β¨
lowkey this page came fromperl v5.36.0, dated2022-12-12. that's the version and the date, and that's the sign-off β stay hydrated, read your docs, and go construct something beautiful ππ¦π
π¦ 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