MooseX::App::Role(3)
π NAME π
MooseX::App::Role(3) β Define attributes in a role. Thatβs the whole vibe, bestie: this is the module for putting attributes in a role, and itβs giving reusable main-character energy. π
β¨ SYNOPSIS β¨
Okay so hereβs the exact group-chat screenshot of how it goes:
package MyApp::Role::SomeRole;
use MooseX::App::Role; # Alo loads Moose::Role
option 'testattr' => (
isa => 'rw',
cmd_tags => [qw(Important! Nice))],
);
That # Alo loads Moose::Role comment is exactly as printed β typo and all, no cap π β and itβs telling you it also loads Moose::Role.
πΈ DESCRIPTION πΈ
This module enables the option and parameter keywords in your roles. Literally thatβs the serve. β¨
Alternatively you can also just use attribute traits:
has 'testattr' => (
isa => 'rw',
traits => ['AppOption'], # required
cmd_type => 'option', # required
cmd_tags => [qw(Important! Nice))],
);
The # required tags on traits => ['AppOption'] and cmd_type => 'option' are not decorative, bestie β theyβre required. π¨
Signed off with full main-character energy: this was the MooseX::App::Role(3) page from User Contributed Perl Documentation, perl v5.42.0, dated 2024-08-09. π
π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-MooseX-App 1.430.1-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms