blib/lib/Dallycot/AST/PropertyLit.pm

filter: Statementstmt 88.4% 23 / 26 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 81.0% 30 / 37 CC 3 SCAR 7.3
CC
3
Cov
80%
execute
3.9
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« blib/lib/Dallycot/Value/Any.pm ↑ Summary blib/lib/Dallycot/Channel.pm »
1 package Dallycot::AST::PropertyLit;
2 29 our $AUTHORITY = 'cpan:JSMITH';
3  
4 # ABSTRACT: A property literal or name
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 29 ▶use Promises qw(deferred);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub execute {
15 3 ▶ my ( $self, $engine ) = @_;
Subroutine execute: called CC=3 SCAR=13.6
Pod undocumented
16  
17 3 my $d = deferred;
18  
19 3 my ( $ns, $prop ) = @$self;
20  
21 3 ▶ if ( !defined $prop ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $prop) { } 3 0 3
elsif ($engine->has_namespace($ns)) { } 0 0 0
22 3 $d->resolve( Dallycot::Value::String->new( $ns, '' ) );
23 }
24 elsif ( $engine->has_namespace($ns) ) {
25 0 my $nshref = $engine->get_namespace($ns);
26 0 $d->resolve( Dallycot::Value::URI->new( $nshref . $prop ) );
27 }
28 else {
29 0 $d->reject("Undefined namespace '$ns'");
30 }
31  
32 3 return $d->promise;
33 }
34  
35 29 1;
« blib/lib/Dallycot/Value/Any.pm ↑ Summary blib/lib/Dallycot/Channel.pm »