| 1 | package Lego::Part::Transfer; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Class::Utils qw(set_params); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Error::Pure qw(err); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 3 | our $VERSION = 0.04; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # Constructor. | ||||||||||||||||||||||||||||
| 13 | 1 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 1 | my ($class, @params) = @_; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # Create object. | ||||||||||||||||||||||||||||
| 17 | 1 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | # Process parameters. | ||||||||||||||||||||||||||||
| 20 | 1 | set_params($self, @params); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | # Object. | ||||||||||||||||||||||||||||
| 23 | 1 | return $self; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | # Convert element to design. | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub element2design { | ||||||||||||||||||||||||||
|
Subroutine
element2design: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 0 | my ($self, $part) = @_; | |||||||||||||||||||||||||||
| 29 | 0 | $self->_check_part($part); | |||||||||||||||||||||||||||
| 30 | 0 | err "This is abstract class. element2design() method not implemented."; | |||||||||||||||||||||||||||
| 31 | 0 | return; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | # Convert design to element. | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | sub design2element { | ||||||||||||||||||||||||||
|
Subroutine
design2element: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 36 | 0 | my ($self, $part) = @_; | |||||||||||||||||||||||||||
| 37 | 0 | $self->_check_part($part); | |||||||||||||||||||||||||||
| 38 | 0 | err "This is abstract class. design2element() method not implemented."; | |||||||||||||||||||||||||||
| 39 | 0 | return; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | # Check part class. | ||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub _check_part { | ||||||||||||||||||||||||||
|
Subroutine
_check_part: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 44 | 0 | my ($self, $part) = @_; | |||||||||||||||||||||||||||
| 45 | 0 | ▶ | if (! blessed($part) || ! $part->isa('Lego::Part')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($part) and $part->isa("Lego::Part")
MC/DC0%0/2
builtin::blessed($part) and $part->isa("Lego::Part")
builtin::blessed($part)
$part->isa("Lego::Part")
Truth table0%0/3
A and B
A= builtin::blessed($part)B= $part->isa("Lego::Part")
| |||||||||||||||||||||||||||||
| 46 | 0 | err "Part must be Lego::Part object."; | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | 0 | return; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 3 | 1; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | __END__ | ||||||||||||||||||||||||||||