| 1 | package WWW::Scraper::ISBN::Record; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 7 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 7 | our $VERSION = '1.05'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | #---------------------------------------------------------------------------- | ||||||||||||||||||||
| 9 | # Public API | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 5 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 12 | 5 | my $proto = shift; | |||||||||||||||||||
| 13 | 5 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition66%2/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table66%2/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 14 | 5 | my $self = { | |||||||||||||||||||
| 15 | ISBN => undef, | ||||||||||||||||||||
| 16 | FOUND => 0, | ||||||||||||||||||||
| 17 | FOUND_IN => undef, | ||||||||||||||||||||
| 18 | BOOK => undef, | ||||||||||||||||||||
| 19 | ERROR => '', | ||||||||||||||||||||
| 20 | }; | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 5 | bless ($self, $class); | |||||||||||||||||||
| 23 | 5 | return $self; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 8 | ▶ | sub isbn { my $self = shift; return $self->_accessor('ISBN',@_) } | ||||||||||||||||||
|
Subroutine
isbn: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 27 | 6 | ▶ | sub found { my $self = shift; return $self->_accessor('FOUND',@_) } | ||||||||||||||||||
|
Subroutine
found: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 28 | 3 | ▶ | sub found_in { my $self = shift; return $self->_accessor('FOUND_IN',@_) } | ||||||||||||||||||
|
Subroutine
found_in: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 29 | 6 | ▶ | sub book { my $self = shift; return $self->_accessor('BOOK',@_) } | ||||||||||||||||||
|
Subroutine
book: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 30 | 6 | ▶ | sub error { my $self = shift; return $self->_accessor('ERROR',@_) } | ||||||||||||||||||
|
Subroutine
error: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 29 | ▶ | sub _accessor { | ||||||||||||||||||
|
Subroutine
_accessor: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 33 | 29 | my $self = shift; | |||||||||||||||||||
| 34 | 29 | my $accessor = shift; | |||||||||||||||||||
| 35 | 29 | ▶ | if (@_) { $self->{$accessor} = shift }; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 36 | 29 | return $self->{$accessor}; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 7 | 1; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||