File Coverage

blib/lib/Bolts/Blueprint/Role/Injector.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Bolts::Blueprint::Role::Injector;
2             $Bolts::Blueprint::Role::Injector::VERSION = '0.143171';
3             # ABSTRACT: Tags a blueprint as being usable during injection
4              
5 11     11   4775 use Moose::Role;
  11         15  
  11         78  
6              
7             with 'Bolts::Blueprint';
8              
9              
10             requires 'exists';
11             1;
12              
13             __END__
14              
15             =pod
16              
17             =encoding UTF-8
18              
19             =head1 NAME
20              
21             Bolts::Blueprint::Role::Injector - Tags a blueprint as being usable during injection
22              
23             =head1 VERSION
24              
25             version 0.143171
26              
27             =head1 DESCRIPTION
28              
29             This role tags a class as a blueprint that may be used for injection. The difference between a common blueprint and an injector blueprint is that the parameters passed for an injector will always be passed as a hash in list form. Whereas a regular blueprint may receive any kind of argument list. Also, the injection parameters are not as well targeted or filtered as they are during regular blueprint resolution.
30              
31             A blueprint may implement this instead of L<Bolts::Blueprint> if it could be useful to during injection and ignores or is able to process parameters as a hash.
32              
33             =head1 ROLES
34              
35             =over
36              
37             =item *
38              
39             L<Bolts::Blueprint>
40              
41             =back
42              
43             =head1 REQUIRED METHODS
44              
45             =head2 exists
46              
47             my $exists = $blueprint->exists($bag, $name, %params);
48              
49             Given a set of parameters, this returns whether or not the value provided by the blueprint exists or not. This is used to determine whether or not the injector should even be run.
50              
51             =head1 AUTHOR
52              
53             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
54              
55             =head1 COPYRIGHT AND LICENSE
56              
57             This software is copyright (c) 2014 by Qubling Software LLC.
58              
59             This is free software; you can redistribute it and/or modify it under
60             the same terms as the Perl 5 programming language system itself.
61              
62             =cut