File Coverage

blib/lib/Bolts/Role/Artifact.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::Role::Artifact;
2             $Bolts::Role::Artifact::VERSION = '0.142930';
3             # ABSTRACT: The role implemented by resolved artifacts
4              
5 8     8   3611 use Moose::Role;
  8         11  
  8         48  
6              
7              
8             requires 'get';
9              
10              
11             requires 'such_that';
12              
13             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.142930
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