Commit | Line | Data |
---|---|---|
5a17a185 | 1 | package Role::Tiny::With; |
a1164a0b | 2 | |
3 | use strict; | |
4 | use warnings FATAL => 'all'; | |
7ed7eba7 | 5 | |
c075f2b0 | 6 | our $VERSION = '1.003003'; |
7ed7eba7 | 7 | $VERSION = eval $VERSION; |
8 | ||
8b14bafd | 9 | use Role::Tiny (); |
a1164a0b | 10 | |
11 | use Exporter 'import'; | |
12 | our @EXPORT = qw( with ); | |
13 | ||
14 | sub with { | |
15 | my $target = caller; | |
836aea1b | 16 | Role::Tiny->apply_roles_to_package($target, @_) |
a1164a0b | 17 | } |
18 | ||
19 | 1; | |
a1164a0b | 20 | |
21 | =head1 NAME | |
22 | ||
23 | Role::Tiny::With - Neat interface for consumers of Role::Tiny roles | |
24 | ||
25 | =head1 SYNOPSIS | |
26 | ||
27 | package Some::Class; | |
28 | ||
29 | use Role::Tiny::With; | |
30 | ||
31 | with 'Some::Role'; | |
32 | ||
33 | # The role is now mixed in | |
34 | ||
35 | =head1 DESCRIPTION | |
36 | ||
37 | C<Role::Tiny> is a minimalist role composition tool. C<Role::Tiny::With> | |
38 | provides a C<with> function to compose such roles. | |
39 | ||
40 | =head1 AUTHORS | |
41 | ||
c334a5c1 | 42 | See L<Role::Tiny> for authors. |
a1164a0b | 43 | |
44 | =head1 COPYRIGHT AND LICENSE | |
45 | ||
c334a5c1 | 46 | See L<Role::Tiny> for the copyright and license. |
a1164a0b | 47 | |
48 | =cut | |
49 | ||
50 |