Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: The best Moo::Role way to do an alias to 'after BUILD'

by tobyink (Abbot)
on Jan 04, 2013 at 20:57 UTC ( #1011719=note: print w/replies, xml ) Need Help??

in reply to The best Moo::Role way to do an alias to 'after BUILD'

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 ) = @_; ... }); }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011719]
[1nickt]: The Google-fu is strong with this one.
[1nickt]: I was looking at Best Buy since like the in-store return/repace plan ... but the 17" HP Envy they have is not this one ....
[1nickt]: May be brand new ... 0 reviews on the site.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2017-03-26 18:16 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (315 votes). Check out past polls.