blib/lib/Dallycot/AST/Negation.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 6 / 8 Podpod 0.0% 0 / 3 totaltotal 71.8% 23 / 32 CC 1 SCAR 2.2
CC
1
Cov
81%
to_string
2.0
to_rdf
2.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Dallycot/AST/Uses.pm ↑ Summary blib/lib/Dallycot/AST/Identity.pm »
1 package Dallycot::AST::Negation;
2 29 our $AUTHORITY = 'cpan:JSMITH';
3  
4 # ABSTRACT: Negate a numeric value
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  
12 sub to_string {
13 0 ▶ my ($self) = @_;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
14  
15 0 return "-" . $self->[0]->to_string;
16 }
17  
18 sub to_rdf {
19 0 ▶ my($self, $model) = @_;
Subroutine to_rdf: not called CC=1 SCAR=6.9
Pod undocumented
20  
21 0 return $model -> apply(
22 $model -> meta_uri('loc:negate'),
23 [ $self->[0] ],
24 {}
25 );
26 # my $bnode = $model -> bnode;
27 # $model -> add_type($bnode, 'loc:Negation');
28 # $model -> add_expression($self -> [0]);
29 # return $bnode;
30 }
31  
32 sub execute {
33 24 ▶ my ( $self, $engine ) = @_;
Subroutine execute: called CC=1 SCAR=0.0
Pod undocumented
34  
35 return $engine->execute( $self->[0], ['Numeric'] )->then(
36 sub {
37 24 ▶ return $_[0] -> negated;
Subroutine __ANON__: called CC=1 SCAR=0.0
38 }
39 24 );
40 }
41  
42 29 1;
« blib/lib/Dallycot/AST/Uses.pm ↑ Summary blib/lib/Dallycot/AST/Identity.pm »