| 1 | package DTL::Fast::Cache::Runtime; | ||||||||||
| 2 | 98 | ▶ | use strict; use warnings FATAL => 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 98 | ▶ | use parent 'DTL::Fast::Cache'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | # Runtime cache for compiled templates | ||||||||||
| 6 | |||||||||||
| 7 | #@Override | ||||||||||
| 8 | sub new | ||||||||||
| 9 | { | ||||||||||
| 10 | 7 | ▶ | my( $proto, %kwargs ) = @_; | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | |||||||||||
| 12 | 7 | $kwargs{'cache'} = {}; | |||||||||
| 13 | |||||||||||
| 14 | 7 | return $proto->SUPER::new(%kwargs); | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | sub read_data | ||||||||||
| 18 | { | ||||||||||
| 19 | 92 | ▶ | my( $self, $key ) = @_; | ||||||||
|
Subroutine
read_data: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||
| 20 | 92 | ▶ | return if not defined $key; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 92 | ▶ | return exists $self->{'cache'}->{$key} ? $self->{'cache'}->{$key}: undef; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | sub write_data | ||||||||||
| 26 | { | ||||||||||
| 27 | 53 | ▶ | my( $self, $key, $data ) = @_; | ||||||||
|
Subroutine
write_data: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||
| 28 | 53 | ▶ | return if not defined $key; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 53 | ▶ | return if not defined $data; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 53 | $self->{'cache'}->{$key} = $data; | |||||||||
| 31 | 53 | return $self; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | #@Override | ||||||||||
| 35 | sub clear | ||||||||||
| 36 | { | ||||||||||
| 37 | 0 | ▶ | my( $self ) = @_; | ||||||||
|
Subroutine
clear: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 38 | 0 | $self->{'cache'} = {}; | |||||||||
| 39 | 0 | return $self; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 98 | 1; | |||||||||