File Coverage

blib/lib/SpeL/Object/Relation.pm
Criterion Covered Total %
statement 26 26 100.0
branch 7 8 87.5
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 42 43 97.6


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2             # ABSTRACT: LaTeX relation object
3              
4              
5 41     41   261 use strict;
  41         75  
  41         1606  
6 41     41   221 use warnings;
  41         81  
  41         2226  
7             package SpeL::Object::Relation;
8              
9 41     41   19891 use SpeL::Object::RelOperator;
  41         158  
  41         2538  
10 41     41   19646 use SpeL::Object::Expression;
  41         175  
  41         2443  
11              
12 41     41   313 use parent 'Exporter';
  41         80  
  41         187  
13 41     41   2140 use Carp;
  41         80  
  41         2821  
14              
15 41     41   288 use Data::Dumper;
  41         78  
  41         8883  
16              
17              
18              
19             sub read {
20 168     168 1 338 my $self = shift;
21 168         373 my ( $level, $separator ) = @_;
22              
23             return
24             ( exists $self->{Left} ? $self->{Left}->read( $level + 1 ) : '' )
25             . ' ' .
26             ( exists $self->{RelationChain} ?
27             join( ' ', map { $_->{RelOperator}->read( $level + 1 ) .
28             ( exists $_->{Right} ?
29 78 100       369 ' ' . $_->{Right}->read( $level + 1 ) : '' ) }
30 168 100       968 @{$self->{RelationChain}} ) : '' ) .
  50 100       164  
    50          
31             ( defined $separator ? $separator : '' );
32             }
33              
34             1;
35              
36             __END__