Bolts/Role/Artifact.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/Injector/Store/Hash.pm ↑ Summary Bolts/Role/Initializer.pm »
1 package Bolts::Role::Artifact;
2 10 $Bolts::Role::Artifact::VERSION = '0.143170';
3 # ABSTRACT: The role implemented by resolved artifacts
4  
5 10 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 10 requires 'get';
9  
10  
11 10 requires 'such_that';
12  
13 10 1;
14  
15 __END__
16  
17 =pod
18  
19 =encoding UTF-8
20  
21 =head1 NAME
22  
23 Bolts::Role::Artifact - The role implemented by resolved artifacts
24  
25 =head1 VERSION
26  
27 version 0.143170
28  
29 =head1 DESCRIPTION
30  
31 An artifact can be any kind of object. However, during acquistion, the resolution phase is only performed on objects implementing this role. Resolution allows the artifact to make decisions about how to construct, inject dependencies, and cache the object.
32  
33 =head1 REQUIRED METHODS
34  
35 =head2 get
36  
37 my $resolved_artifact = $artifact->get($bag, %options);
38  
39 This method is called during resolution to all the artifact to decide how to resolve the real artifact.
40  
41 =head2 such_that
42  
43 $artifact->such_that(
44 isa => $type,
45 does => $type,
46 );
47  
48 This applies type constraints to the resolved object. These are invariants that should be applied as soon as the artifact is able to do so.
49  
50 =head1 AUTHOR
51  
52 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
53  
54 =head1 COPYRIGHT AND LICENSE
55  
56 This software is copyright (c) 2014 by Qubling Software LLC.
57  
58 This is free software; you can redistribute it and/or modify it under
59 the same terms as the Perl 5 programming language system itself.
60  
61 =cut
« Bolts/Injector/Store/Hash.pm ↑ Summary Bolts/Role/Initializer.pm »