| 1 | package Dallycot::Value::Any; | ||||||||||||||||||||
| 2 | 30 | our $AUTHORITY = 'cpan:JSMITH'; | |||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | # ABSTRACT: Base class for most value types | ||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 30 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 30 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 30 | ▶ | use utf8; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 30 | ▶ | use parent 'Dallycot::Value'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 30 | ▶ | use Carp qw(croak); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 30 | ▶ | use Promises qw(deferred); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | sub value { | ||||||||||||||||||||
| 16 | 558 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 558 | return $self->[0]; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 0 | ▶ | sub is_defined { return 1 } | ||||||||||||||||||
|
Subroutine
is_defined: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | sub successor { | ||||||||||||||||||||
| 24 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
successor: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | my $d = deferred; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | $d->reject( $self->type . " has no successor" ); | |||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | return $d->promise; | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | sub predecessor { | ||||||||||||||||||||
| 34 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
predecessor: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 0 | my $d = deferred; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | $d->reject( $self->type . " has no predecessor" ); | |||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | return $d->promise; | |||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | sub to_string { | ||||||||||||||||||||
| 44 | 0 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
to_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 45 | 0 | return $self->id; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | sub negated { | ||||||||||||||||||||
| 49 | 0 | ▶ | my($self) = @_; | ||||||||||||||||||
|
Subroutine
negated: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | my $class = ref $self || $self; | ||||||||||||||||||
|
Condition0%0/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 52 | 0 | $class =~ /::([^:]+)$/; | |||||||||||||||||||
| 53 | 0 | croak "negation is not supported for $1"; | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 30 | 1; | |||||||||||||||||||