blob: d8d95e9ccc86cf2b6fcf1aa0d0aea290e2b2fbb0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package Net::Hawk::Role::WithCrypto; use strict; use warnings; use 5.010; use Package::Variant importing => ['Moo::Role'], subs => ['has']; use Types::Standard 1.000003 qw(HasMethods); sub make_variant { my ($class,$target_package,@methods) = @_; has _crypto => ( is => 'ro', (@methods ? ( isa => HasMethods[@methods] ) : () ), init_arg => 'crypto', default => sub { require Net::Hawk::Crypto; Net::Hawk::Crypto->new; }, ); } 1;
|