File Coverage

blib/lib/Bolts/Meta/Class/Trait/Locator.pm
Criterion Covered Total %
statement 8 11 72.7
branch n/a
condition n/a
subroutine 4 7 57.1
pod 4 4 100.0
total 16 22 72.7


line stmt bran cond sub pod time code
1             package Bolts::Meta::Class::Trait::Locator;
2             $Bolts::Meta::Class::Trait::Locator::VERSION = '0.142930';
3             # ABSTRACT: Metaclass role for objects that have a meta locator
4              
5 8     8   19591 use Moose::Role;
  8         16  
  8         51  
6              
7 8     8   34012 use Bolts::Meta::Locator;
  8         24  
  8         1322  
8              
9              
10             has locator => (
11             is => 'rw',
12             does => 'Bolts::Role::Locator',
13             lazy_build => 1,
14             );
15              
16             sub _build_locator {
17 16     16   170 $Bolts::GLOBAL_FALLBACK_META_LOCATOR->new;
18             }
19              
20              
21 152     152 1 5463 sub acquire { shift->locator->acquire(@_) }
22 0     0 1   sub acquire_all { shift->locator->acquire_all(@_) }
23 0     0 1   sub resolve { shift->locator->resolve(@_) }
24 0     0 1   sub get { shift->locator->get(@_) }
25              
26             with 'Bolts::Role::Locator';
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Bolts::Meta::Class::Trait::Locator - Metaclass role for objects that have a meta locator
39              
40             =head1 VERSION
41              
42             version 0.142930
43              
44             =head1 DESCRIPTION
45              
46             This is another handy feature for use when constructing and managing a bag of artifacts. It provides a meta locator to the class for looking up standard Bolts objects like blueprints, scopes, injectors, inferrers, etc.
47              
48             =head1 ROLES
49              
50             =over
51              
52             =item *
53              
54             L<Bolts::Role::Locator>
55              
56             =back
57              
58             =head1 ATTRIBUTES
59              
60             =head2 locator
61              
62             This returns an implementation of L<Bolts::Role::Locator> containing the needed standard Bolts objects.
63              
64             Defaults to a new object from L<Bolts/$Bolts::GLOBAL_FALLBACK_META_LOCATOR>, which defaults to L<Bolts::Meta::Locator>.
65              
66             =head2 acquire
67              
68             Delegated to the C<acquire> method of L</locator>.
69              
70             =head2 acquire_all
71              
72             Delegated to the C<acquire_all> method of L</locator>.
73              
74             =head2 resolve
75              
76             Delegated to the C<resolve> method of L</locator>.
77              
78             =head2 get
79              
80             Delegated to the C<get> method of L</locator>.
81              
82             =head1 AUTHOR
83              
84             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
85              
86             =head1 COPYRIGHT AND LICENSE
87              
88             This software is copyright (c) 2014 by Qubling Software LLC.
89              
90             This is free software; you can redistribute it and/or modify it under
91             the same terms as the Perl 5 programming language system itself.
92              
93             =cut