Bolts/Blueprint/Role/Injector.pm

filter: Statementstmt 100% 7 / 7 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 8 / 8 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Bolts/Blueprint/ParentBag.pm ↑ Summary Bolts/Inference.pm »
1 package Bolts::Blueprint::Role::Injector;
2 10 $Bolts::Blueprint::Role::Injector::VERSION = '0.143170';
3 # ABSTRACT: Tags a blueprint as being usable during injection
4  
5 10 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 10 with 'Bolts::Blueprint';
8  
9  
10 10 requires 'exists';
11 10 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.143170
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
« Bolts/Blueprint/ParentBag.pm ↑ Summary Bolts/Inference.pm »