aboutsummaryrefslogtreecommitdiff
path: root/lib/Sietima/Role/WithAdmin.pm
blob: 829362197804da57423963d6450cdfa68a76cda1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package Sietima::Role::WithAdmin; 
use Moo::Role;
use Sietima::Policy;
use Sietima::Types qw(Address AddressFromStr);
use namespace::clean;
 
has admin => (
    is => 'ro',
    isa => Address,
    required => 1,
    coerce => AddressFromStr,
);
 
around list_addresses => sub($orig,$self) {
    return +{
        $self->$orig->%*,
        admin => $self->admin,
    };
};
 
1;