Messag...ponent(3pm)

πŸ“¦
version 0.117 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– Message::Passing::Role::CLIComponent πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation page for Message::Passing::Role::CLIComponent(3pm) β€” yes that's a whole mouthful, we know, but stick with me, it's actually iconic ✨


🌸 NAME 🌸

Message::Passing::Role::CLIComponent β€” it's a Package::Variant situation, and it hands you foo and foo_options attributes πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the vibe, copy-paste ready, no cap:

package My::Message::Passing::Script;
use Moo;
use MooX::Options;
use Message::Passing::Role::CLIComponent;
use Message::Passing::DSL;
use namespace::clean -except => 'meta';

with
    CLIComponent( name => 'input', default => 'STDIN' ),
    'Message::Passing::Role::Script';

sub build_chain {
    my $self = shift;
    message_chain {
        input example => ( %{ $self->input_options }, output_to => 'test_out', class => $self->input, );
        output test_out => ( ... );
    };
}

__PACKAGE__->start unless caller;
1;

look at that. chef's kiss. πŸ’…


✨ DESCRIPTION ✨

so basically this is a Package::Variant role producer, and what it does is serve you up a pair of attributes β€” one for name, one for options β€” exactly like the message-pass script does it. that's the whole gig, and it ate. πŸ”₯


πŸ‘‘ ROLE PARAMETERS πŸ‘‘

🌈 name

the name of the main attribute, bestie. and here's the cute part β€” an extra attribute called ${name}_options gets added alongside it, and it coerces a hashref from JSON. two for the price of one, we love to see it 🫢

🌸 default

a default value for the main attribute. but lowkey important: if you don't supply this one, then the attribute becomes required instead. so like, you gotta pick a lane. πŸ’€


πŸŽ€ SPONSORSHIP πŸŽ€

this module literally exists because of the wonderful people at Suretec Systems Ltd. <http://www.suretecsystems.com/> β€” they sponsored its development for their VoIP division called SureVoIP <http://www.surevoip.co.uk/>, for use with the SureVoIP API β€” <http://www.surevoip.co.uk/support/wiki/api_documentation> πŸ₯Ή

shoutout to them fr fr, funding open source is main character energy πŸ‘‘


see Message::Passing. that's it, that's the whole section, go peek over there bestie πŸ™ˆ


ngl if you're still here, you're a real one. go build something slay with it πŸ’–

and that's a wrap, babes! this page comes to you from perl v5.32.1, dated 2021-11-09, under the Messag...ponent(3pm) name β€” mwah, periodt βœ¨πŸ¦‹πŸ’