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