Method...ructor(3pm)

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

πŸ’– Method::Generate::Constructor::Role::StrictConstructor β€” the perl manual page, but make it make sense πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation section of the perl manual β€” the manual name is Method::Generate::Constructor::Role::StrictConstructor, and no, that name is not a typo, it's just perl being perl. 🫢


✨ NAME ✨

Method::Generate::Constructor::Role::StrictConstructor β€” it's literally a role that makes Moo constructors strict. that's it. that's the whole vibe. πŸ’…


🌸 VERSION 🌸

version 0.011 β€” yes she's on 0.011, she's a whole person, don't judge her.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea, bestie: this role wraps _assign_new in Method::Generate::Constructor with a little bit of code. and what does that little bit of code do? it makes sure that every single argument you hand to the constructor is a valid init_args for the class. πŸŽ€

like, if you try to pass it something that isn't a legit init_args, it's gonna notice. no sneaky extra args slipping through the door. the vibe check is mandatory and everyone gets checked. periodt.

πŸ‘‘ STANDING ON THE SHOULDERS OF ... πŸ‘‘

ngl, this code would not exist without the examples in MooX::InsideOut and MooseX::StrictConstructor. full credit to the ancestors, we are simply standing on their shoulders and we are grateful. πŸ’œ


πŸ’€ SEE ALSO πŸ’€

  • MooX::InsideOut
  • MooseX::StrictConstructor

🧚 AUTHOR 🧚

George Hartzell <hartzell@cpan.org> β€” icon behavior, honestly. 🫑


This software is copyright (c) 2020 by George Hartzell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

fr fr, it's free software under the same terms as the Perl 5 programming language system itself β€” go wild, but legally. πŸ’–

and that's the whole page, bestie!! πŸŽ‰ this little gem came to you courtesy of perl v5.36.0, dated 2022-12-06, from the Method...ructor(3pm) page. go forth and construct strictly. πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from