MooseX:...nvelope(3)

πŸŽ€ NAME πŸŽ€

MooseX::App::Message::Envelope β€” Message presented to the user πŸ’–

okay so this is the User Contributed Perl Documentation page, and the manual name up top is MooseX:...nvelope(3) (ellipsis included, no notes πŸ’…).

✨ DESCRIPTION ✨

Whenever MooseX::App needs to pass a message to the user, it does so by generating a MooseX::App::Message::Envelope object. No cap. The object usually contains one or more blocks (MooseX::App::Message::Block) and can be easily stringified β€” slay.

Usually a MooseX::App::Message::Envelope object is generated and returned by the new_with_command method in MooseX::App::Base if there is an error or if the user requests help. So like, error? help? envelope. 🫢

To avoid useless object type checks when working with this method, MooseX::App::Message::Envelope follows the Null-class pattern. So you can do this, no matter if new_with_command fails or not:

MyApp->new_with_command->some_method->only_called_if_successful;
and then the original description just ends with a lonely If before METHODS 😭 bestie I’m not editing that out β€” it’s part of the lore.

πŸ’… METHODS πŸ’…

πŸ¦‹ stringify πŸ¦‹

Stringifies the messages. iconic behavior, honestly.

🌸 overload 🌸

This method is called whenever the object is stringified via overload. In this case it prints the message on either STDERR or STDOUT, and exits the process with the given exitcode (if any). yes, it really said β€œeither” and yes, it exits β€” read that twice if you need to πŸ‘‘

πŸŽ€ add_block πŸŽ€

Adds a new message block. Param must be a MooseX::App::Message::Block.

πŸ“ list_blocks πŸ“

Returns a list on message blocks. (the page says β€œon”, not β€œof” β€” I’m just the messenger πŸ’…)

🧚 blocks 🧚

Message block accessor.

πŸ’œ exitcode πŸ’œ

Exitcode accessor.

⭐ has_exitcode ⭐

Check if exitcode is set.

πŸ”₯ OVERLOAD πŸ”₯

Stringification of this object is overloaded.

πŸ’€ AUTOLOAD πŸ’€

You can call any method on the message class.


okay bye bestie πŸ’–βœ¨ this page is from perl v5.42.0, dated 2024-08-09, and the manual footer is MooseX:...nvelope(3) β€” mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from