| 1 | ### Change History | ||||||||||||||||||||
| 2 | # 1999-02-21 Created. -Simon | ||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | package Data::Quantity::Abstract::Compound; | ||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | require 5; | |||||||||||||||||||
| 7 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 1 | ▶ | use vars qw( $VERSION ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 1 | $VERSION = 0.001; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | ▶ | use Data::Quantity::Abstract::Base '-isasubclass'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | # $clone_q = $quantity->new_instance(); | ||||||||||||||||||||
| 16 | # $empty_q = Data::Quantity::Abstract::Compound->new_instance(); | ||||||||||||||||||||
| 17 | 2 | ▶ | sub new_instance { | ||||||||||||||||||
|
Subroutine
new_instance: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||||||||||||
| 18 | 2 | my $referent = shift; | |||||||||||||||||||
| 19 | 2 | ▶ | my $class = ref($referent) || $referent; | ||||||||||||||||||
|
Condition33%1/3
ref $referent || $referent
MC/DC0%0/2
ref $referent || $referent
ref $referent
$referent
Truth table33%1/3
A || B
A= ref $referentB= $referent
| |||||||||||||||||||||
| 20 | my $month_q = [ | ||||||||||||||||||||
| 21 | 2 | ▶ | map { $_->new_instance } ( | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 22 | ref($referent) ? ( @$referent ) : $class->component_classes | ||||||||||||||||||||
| 23 | ) | ||||||||||||||||||||
| 24 | ]; | ||||||||||||||||||||
| 25 | 2 | bless $month_q, $class; | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | ▶ | sub component_classes { | ||||||||||||||||||
|
Subroutine
component_classes: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 29 | 0 | die "abstract!"; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | # $quantity->init( $year, $month ); | ||||||||||||||||||||
| 33 | 2 | ▶ | sub init { | ||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 34 | 2 | my $month_q = shift; | |||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 2 | @$month_q = @_; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||