| 1 | package Dallycot::Value::EmptyStream; | ||||||||||||
| 2 | 30 | our $AUTHORITY = 'cpan:JSMITH'; | |||||||||||
| 3 | |||||||||||||
| 4 | # ABSTRACT: A stream with no values | ||||||||||||
| 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::Collection'; | ||||||||||
|
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 | sub new { | ||||||||||||
| 17 | 13 | ▶ | return $INSTANCE ||= bless [] => __PACKAGE__; | ||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
undocumented
Condition100%2/2
$Dallycot::Value::EmptyStream::INSTANCE ||= bless([], __PACKAGE__)
MC/DC100%1/1
$Dallycot::Value::EmptyStream::INSTANCE ||= bless([], __PACKAGE__)
$Dallycot::Value::EmptyStream::INSTANCE
Truth table100%2/2
A
A= $Dallycot::Value::EmptyStream::INSTANCE
| |||||||||||||
| 18 | } | ||||||||||||
| 19 | |||||||||||||
| 20 | sub to_rdf { | ||||||||||||
| 21 | 0 | ▶ | my($self, $model) = @_; | ||||||||||
|
Subroutine
to_rdf: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 22 | |||||||||||||
| 23 | 0 | return $model -> add_list; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | sub prepend { | ||||||||||||
| 27 | 1 | ▶ | my ( $self, @things ) = @_; | ||||||||||
|
Subroutine
prepend: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 28 | |||||||||||||
| 29 | 1 | my $stream = Dallycot::Value::Stream->new( shift @things ); | |||||||||||
| 30 | 1 | foreach my $thing (@things) { | |||||||||||
| 31 | 1 | $stream = Dallycot::Value::Stream->new( $thing, $stream ); | |||||||||||
| 32 | } | ||||||||||||
| 33 | 1 | return $stream; | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | 0 | ▶ | sub as_text { return "[ ]" } | ||||||||||
|
Subroutine
as_text: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 37 | |||||||||||||
| 38 | 16 | ▶ | sub is_empty { return 1 } | ||||||||||
|
Subroutine
is_empty: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 39 | |||||||||||||
| 40 | 16 | ▶ | sub is_defined { return 1 } | ||||||||||
|
Subroutine
is_defined: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 41 | |||||||||||||
| 42 | 0 | ▶ | sub _type { return 'Stream' } | ||||||||||
|
Subroutine
_type: not called CC=1 SCAR=6.9
| |||||||||||||
| 43 | |||||||||||||
| 44 | sub calculate_length { | ||||||||||||
| 45 | 0 | ▶ | my ( $self, $engine ) = @_; | ||||||||||
|
Subroutine
calculate_length: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 46 | |||||||||||||
| 47 | 0 | return $engine->ZERO; | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | sub calculate_reverse { | ||||||||||||
| 51 | 0 | ▶ | my ( $self, $engine ) = @_; | ||||||||||
|
Subroutine
calculate_reverse: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 52 | |||||||||||||
| 53 | 0 | my $d = deferred; | |||||||||||
| 54 | |||||||||||||
| 55 | 0 | $d->resolve($self); | |||||||||||
| 56 | |||||||||||||
| 57 | 0 | return $d->promise; | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | sub apply_map { | ||||||||||||
| 61 | 0 | ▶ | my ( $self, $engine, $transform ) = @_; | ||||||||||
|
Subroutine
apply_map: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 62 | |||||||||||||
| 63 | 0 | return $self; | |||||||||||
| 64 | } | ||||||||||||
| 65 | |||||||||||||
| 66 | sub apply_filter { | ||||||||||||
| 67 | 0 | ▶ | my ( $self, $engine, $transform ) = @_; | ||||||||||
|
Subroutine
apply_filter: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 68 | |||||||||||||
| 69 | 0 | return $self; | |||||||||||
| 70 | } | ||||||||||||
| 71 | |||||||||||||
| 72 | sub value_at { | ||||||||||||
| 73 | 0 | ▶ | my $p = deferred; | ||||||||||
|
Subroutine
value_at: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 74 | |||||||||||||
| 75 | 0 | $p->resolve( Dallycot::Value::Undefined->new ); | |||||||||||
| 76 | |||||||||||||
| 77 | 0 | return $p->promise; | |||||||||||
| 78 | } | ||||||||||||
| 79 | |||||||||||||
| 80 | sub head { | ||||||||||||
| 81 | 1 | ▶ | my $p = deferred; | ||||||||||
|
Subroutine
head: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 82 | |||||||||||||
| 83 | 1 | $p->resolve( Dallycot::Value::Undefined->new ); | |||||||||||
| 84 | |||||||||||||
| 85 | 1 | return $p->promise; | |||||||||||
| 86 | } | ||||||||||||
| 87 | |||||||||||||
| 88 | sub tail { | ||||||||||||
| 89 | 0 | ▶ | my ($self) = @_; | ||||||||||
|
Subroutine
tail: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 90 | |||||||||||||
| 91 | 0 | my $p = deferred; | |||||||||||
| 92 | |||||||||||||
| 93 | 0 | $p->resolve($self); | |||||||||||
| 94 | |||||||||||||
| 95 | 0 | return $p->promise; | |||||||||||
| 96 | } | ||||||||||||
| 97 | |||||||||||||
| 98 | 30 | 1; | |||||||||||