blib/lib/Dallycot/AST/Tail.pm

filter: Statementstmt 90.0% 27 / 30 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 3 totaltotal 81.8% 36 / 44 CC 2 SCAR 2.9
CC
2
Cov
88%
__ANON__
2.1
to_string
2.0
execute
1.0
CRAP 1.3
« blib/lib/Dallycot/AST/Head.pm ↑ Summary blib/lib/Dallycot/AST/StrictlyDecreasing.pm »
1 package Dallycot::AST::Tail;
2 29 our $AUTHORITY = 'cpan:JSMITH';
3  
4 # ABSTRACT: Finds the rest of a collection
5  
6 29 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 29 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 29 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 29 ▶use parent 'Dallycot::AST';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 29 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub to_string {
14 0 ▶ my ($self) = @_;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
15  
16 0 return $self->[0]->to_string . '...';
17 }
18  
19 sub to_rdf {
20 2 ▶ my($self, $model) = @_;
Subroutine to_rdf: called CC=1 SCAR=0.0
Pod undocumented
21  
22 2 my $bnode = $model -> bnode;
23 2 $model -> add_type($bnode, 'loc:Tail');
24 2 $model -> add_expression($bnode, $self -> [0]);
25 2 return $bnode;
26 }
27  
28 sub execute {
29 379 ▶ my ( $self, $engine ) = @_;
Subroutine execute: called CC=1 SCAR=0.2
Pod undocumented
30  
31 return $engine->execute( $self->[0] )->then(
32 sub {
33 376 ▶ my ($stream) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.6
34  
35 376 ▶ if ( $stream->can('tail') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($stream->can('tail')) { } 376 0 376
36 376 return $stream->tail($engine);
37 }
38 else {
39 0 croak "The tail operator requires a stream-like object.";
40 }
41 }
42 379 );
43 }
44  
45 29 1;
« blib/lib/Dallycot/AST/Head.pm ↑ Summary blib/lib/Dallycot/AST/StrictlyDecreasing.pm »