Eulerian/EDW/Sql/Group.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 51 CC 2 SCAR 12.0
CC
2
Cov
0%
str
6.0
new
2.0
isset
2.0
CRAP 3.3
1 use strict; use warnings;
2  
3 package API::Eulerian::EDW::Sql::Group;
4  
5 sub new
6 {
7 my $proto = shift;
8 my $class = ref( $proto ) || $proto;
9 my $setup = shift;
10 return bless( {
11 name => $setup->{ name } || undef,
12 with => $setup->{ with } || undef,
13 filter => $setup->{ filter } || undef,
14 }
15 );
16 }
17 #
18 #
19 #
20 #
21 sub isset
22 {
23 my ( $self, $key ) = @_;
24 return exists( $self->{ $key } ) &&
25 defined( $self->{ $key } );
26 }
27  
28 sub str
29 {
30 my ( $self ) = @_;
31 my $str = '';
32  
33 $str .= $self->{ name };
34 $str .= ' WITH ';
35 $str .= $self->{ with };
36 if( $self->isset( 'filter' ) ) {
37 $str .= " IF { ";
38 $str .= $self->{ filter };
39 $str .= " } ";
40 }
41  
42 return $str;
43 }
44  
45 1;
46  
47 __END__