Maybe something like...
{ package Weborama::Collect::CreativesValidator; use Moo::Role; use MooX::ClassAttribute; class_has _registered_validators => ( is => 'ro', default => sub { [] }, ); has _creative_validators => ( is => 'ro', default => sub { [] }, ); sub register_validator { my $class = shift; push @{$class->_registered_validators}, @_; } after BUILD => sub { my $self = shift; my $class = ref $self; push @{$self->_creative_validators}, @{$class->_registered_validat +ors}; }; } { package Weborama::ForcedPause; use Moo::Role; with 'Weborama::Collect::CreativesValidator'; # you have to define that one requires qw/creatives_validator_publisher_forced_pause_settings/; __PACKAGE__->register_validator(sub { my ( $self, @creatives ) = @_; ... }); }
In reply to Re: The best Moo::Role way to do an alias to 'after BUILD'
by tobyink
in thread The best Moo::Role way to do an alias to 'after BUILD'
by celogeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |