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.143171';
3             # ABSTRACT: The role implemented by resolved artifacts
4              
5 11     11   5036 use Moose::Role;
  11         18  
  11         69  
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.143171
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             See L<Bolts::Artifact> for the reference implementation of this method. L<Bolts::Artifact::Thunk> provides a second, simpler, and less featureful implementation.
34              
35             =head1 REQUIRED METHODS
36              
37             =head2 get
38              
39             my $resolved_artifact = $artifact->get($bag, %options);
40              
41             This method is called during resolution to all the artifact to decide how to resolve the real artifact.
42              
43             =head2 such_that
44              
45             $artifact->such_that(
46             isa => $type,
47             does => $type,
48             );
49              
50             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.
51              
52             =head1 AUTHOR
53              
54             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
55              
56             =head1 COPYRIGHT AND LICENSE
57              
58             This software is copyright (c) 2014 by Qubling Software LLC.
59              
60             This is free software; you can redistribute it and/or modify it under
61             the same terms as the Perl 5 programming language system itself.
62              
63             =cut