blib/lib/Mason/CodeCache.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 8 / 8 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Mason/Interp.pm ↑ Summary blib/lib/Mason/t/Autobase.pm »
1 package Mason::CodeCache;
2 $Mason::CodeCache::VERSION = '2.23';
3 22 ▶use Devel::GlobalDestruction;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use Mason::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 use Mason::Util;
6  
7 has 'datastore' => ( is => 'ro', isa => 'HashRef', default => sub { {} } );
8  
9 method get ($key) {
10 return $self->{datastore}->{$key};
11 }
12  
13 method set ($key, $data) {
14 $self->{datastore}->{$key} = $data;
15 }
16  
17 method remove ($key) {
18 if ( my $entry = $self->{datastore}->{$key} ) {
19 if ( !in_global_destruction() ) {
20 my $compc = $entry->{compc};
21 $compc->_unset_class_cmeta();
22 $compc->meta->make_mutable();
23 Mason::Util::delete_package($compc);
24 }
25 delete $self->{datastore}->{$key};
26 }
27 }
28  
29 method get_keys () {
30 return keys( %{ $self->{datastore} } );
31 }
32  
33 __PACKAGE__->meta->make_immutable();
34  
35 1;
36  
37 __END__
38  
39 =pod
40  
41 =head1 NAME
42  
43 Mason::CodeCache - Result returned from Mason request
44  
45 =head1 DESCRIPTION
46  
47 Internal class that manages the cache of components for L<Mason::Interp>.
48  
49 =head1 SEE ALSO
50  
51 L<Mason|Mason>
52  
53 =head1 AUTHOR
54  
55 Jonathan Swartz <swartz@pobox.com>
56  
57 =head1 COPYRIGHT AND LICENSE
58  
59 This software is copyright (c) 2012 by Jonathan Swartz.
60  
61 This is free software; you can redistribute it and/or modify it under
62 the same terms as the Perl 5 programming language system itself.
63  
64 =cut
« blib/lib/Mason/Interp.pm ↑ Summary blib/lib/Mason/t/Autobase.pm »