| 1 | package Dallycot::Value::Undefined; | ||||||||||||
| 2 | 30 | our $AUTHORITY = 'cpan:JSMITH'; | |||||||||||
| 3 | |||||||||||||
| 4 | # ABSTRACT: The Undefined value | ||||||||||||
| 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::Any'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | |||||||||||||
| 12 | 30 | ▶ | use Promises qw(deferred); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 30 | our $INSTANCE; | |||||||||||
| 15 | |||||||||||||
| 16 | 10 | ▶ | sub new { return $INSTANCE ||= bless [] => __PACKAGE__; } | ||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
Condition100%2/2
$Dallycot::Value::Undefined::INSTANCE ||= bless([], __PACKAGE__)
MC/DC100%1/1
$Dallycot::Value::Undefined::INSTANCE ||= bless([], __PACKAGE__)
$Dallycot::Value::Undefined::INSTANCE
Truth table100%2/2
A
A= $Dallycot::Value::Undefined::INSTANCE
| |||||||||||||
| 17 | |||||||||||||
| 18 | ▶ | sub value { } | |||||||||||
|
Subroutine
value: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 19 | |||||||||||||
| 20 | 0 | ▶ | sub id { return '^^Undefined' } | ||||||||||
|
Subroutine
id: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 21 | |||||||||||||
| 22 | sub as_text { | ||||||||||||
| 23 | 0 | ▶ | return "(undef)"; | ||||||||||
|
Subroutine
as_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | sub to_rdf { | ||||||||||||
| 27 | 0 | ▶ | my($self, $model) = @_; | ||||||||||
|
Subroutine
to_rdf: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 28 | |||||||||||||
| 29 | 0 | return $model -> meta_uri('rdf:nil'); | |||||||||||
| 30 | } | ||||||||||||
| 31 | |||||||||||||
| 32 | 0 | ▶ | sub is_defined {return} | ||||||||||
|
Subroutine
is_defined: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 33 | |||||||||||||
| 34 | 0 | ▶ | sub is_empty { return 1 } | ||||||||||
|
Subroutine
is_empty: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 35 | |||||||||||||
| 36 | sub calculate_length { | ||||||||||||
| 37 | 0 | ▶ | my ( $self, $engine ) = @_; | ||||||||||
|
Subroutine
calculate_length: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 38 | |||||||||||||
| 39 | 0 | return $engine->ZERO; | |||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | sub is_equal { | ||||||||||||
| 43 | 0 | ▶ | my ( $self, $engine, $other ) = @_; | ||||||||||
|
Subroutine
is_equal: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 44 | |||||||||||||
| 45 | 0 | my $d = deferred; | |||||||||||
| 46 | |||||||||||||
| 47 | 0 | ▶ | if ( $self eq $INSTANCE ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 48 | 0 | $d->resolve( $engine->TRUE ); | |||||||||||
| 49 | } | ||||||||||||
| 50 | else { | ||||||||||||
| 51 | 0 | $d->resolve( $engine->FALSE ); | |||||||||||
| 52 | } | ||||||||||||
| 53 | |||||||||||||
| 54 | 0 | return $d->promise; | |||||||||||
| 55 | } | ||||||||||||
| 56 | |||||||||||||
| 57 | 30 | *is_less_or_equal = \&is_equal; | |||||||||||
| 58 | 30 | *is_greater_or_equal = \&is_equal; | |||||||||||
| 59 | |||||||||||||
| 60 | sub is_less { | ||||||||||||
| 61 | 0 | ▶ | my ( $self, $engine, $other ) = @_; | ||||||||||
|
Subroutine
is_less: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 62 | |||||||||||||
| 63 | 0 | my $d = deferred; | |||||||||||
| 64 | |||||||||||||
| 65 | 0 | $d->resolve( $engine->FALSE ); | |||||||||||
| 66 | |||||||||||||
| 67 | 0 | return $d; | |||||||||||
| 68 | } | ||||||||||||
| 69 | |||||||||||||
| 70 | 30 | *is_greater = \&is_less; | |||||||||||
| 71 | |||||||||||||
| 72 | 30 | 1; | |||||||||||