summaryrefslogtreecommitdiff
path: root/lib/Enigmatic/Role/WithWiring.pm
blob: df6dc48edc1bbf1c723d97c8c287324e9a813650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package Enigmatic::Role::WithWiring; 
use DAKKAR::p 'role';
 
requires 'BUILDARGS';
requires 'wiring';
 
around BUILDARGS => sub {
    my $orig  = shift;
    my $class = shift;
 
    if ( @_ == 1 && !ref $_[0] ) {
        return $class->$origwiring => $_[0] );
    }
    else {
        return $class->$orig(@_);
    }
};