| 1 | package XML::API::Cache; | ||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use Carp qw(croak); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use overload '""' => \&content; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | our $VERSION = '0.30'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.8
Pod
documented
| |||||||||||||||||||||
| 10 | 1 | my $proto = shift; | |||||||||||||||||||
| 11 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 12 | 1 | ▶ | my $x = shift || croak 'XML::API::Cache->new($x)'; | ||||||||||||||||||
|
Condition50%1/2
shift() || croak('XML::API::Cache->new($x)')
MC/DC0%0/1
shift() || croak('XML::API::Cache->new($x)')
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||
| 13 | 1 | ▶ | $x->isa('XML::API') || croak 'argument must be XML::API derived object'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 1 | my $self = { | |||||||||||||||||||
| 16 | content => $x->_fast_string, | ||||||||||||||||||||
| 17 | langs => [ $x->_langs ], | ||||||||||||||||||||
| 18 | }; | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 1 | bless( $self, $class ); | |||||||||||||||||||
| 21 | 1 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 2 | ▶ | sub langs { | ||||||||||||||||||
|
Subroutine
langs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 25 | 2 | my $self = shift; | |||||||||||||||||||
| 26 | 2 | return @{ $self->{langs} }; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 2 | ▶ | sub content { | ||||||||||||||||||
|
Subroutine
content: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 30 | 2 | my $self = shift; | |||||||||||||||||||
| 31 | 2 | return $self->{content}; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 2 | 1; | |||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||