Cataly...ntainer(3pm)

πŸ“¦
version 5.90132 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Catalyst::ActionContainer β€” Catalyst Action Container πŸ’–

okay bestie, so this is Catalyst::ActionContainer, and fr fr it's exactly what it sounds like: a whole container for actions. that's it. that's the vibe. πŸŽ€


✨ SYNOPSIS ✨

look, we're not gonna make this weird:

See Catalyst.

that's the whole synopsis. go read Catalyst, she's the main character here, this page is literally just her side quest. πŸ¦‹


🌸 DESCRIPTION 🌸

okay so this thing? it's a container for actions. and the way the dispatcher uses it is lowkey iconic β€” it sets up a whole tree of these bad boys to represent all the various dispatch points in your application. yes, a tree. we're being organized. we're thriving. it's giving architecture. πŸ’…


πŸ‘‘ METHODS πŸ‘‘

πŸ“ new(\%data | $part)

you can call this two ways, and both are valid, no cap:

  • with { part => $part, actions => \%actions } β€” full construction, everything handed over upfront, very prepared of you πŸ’–
  • or with just a part β€” in which case you get an empty actions hashref that you'll be populating later via add_action

pick your fighter. ✨

πŸ¦‹ get_action($name)

returns an action from this container, based on the action name. or undef. that's it. sometimes you get the action, sometimes you get undef, that's just life bestie 😭

πŸ’œ add_action($action, [ $name ])

adds an action. and optionally you can hand over a $name to override $action->name β€” because sometimes the action's own name just isn't the moment, and you know better. periodt. πŸ’…

πŸŽ€ actions

accessor to the actions hashref. it contains all the actions in this container. all of them. every single one. no action left behind 🫢

🌈 part

accessor to the path part this container resolves to. also, fun fact, it's what the container stringifies to. so like, when you stringify it, that's the part you get. iykyk ✨

⭐ meta

provided by Moose. don't ask, she came with the furniture 🐭


πŸ’– AUTHORS πŸ’–

Catalyst Contributors, see Catalyst.pm β€” the whole squad, we love them, they ate πŸ”₯


This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. go wild, be free, slay πŸ’…βœ¨


and that's the page bestie!! πŸŽ€ this was perl v5.40.0, dated 2024-11-15, from the User Contributed Perl Documentation β€” mwah, ty for reading, love u, bye πŸ’–πŸ¦‹πŸŒΈπŸ‘‘

πŸ“¦ where this page comes from