File Coverage

blib/lib/DS/Target/Sub.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             #!perl
2            
3             # ########################################################################## #
4             # Title: Data stream sink
5             # Creation date: 2007-04-16
6             # Author: Michael Zedeler
7             # Description: Receives data and does nothing.
8             # Data Stream class
9             # File: $Source: /data/cvs/lib/DSlib/lib/DS/Target/Sub.pm,v $
10             # Repository: kronhjorten
11             # State: $State: Exp $
12             # Documentation: inline
13             # Recepient: -
14             # ########################################################################## #
15            
16             package DS::Target::Sub;
17            
18 1     1   4 use base qw{ DS::Target };
  1         1  
  1         55  
19            
20 1     1   4 use strict;
  1         1  
  1         32  
21            
22 1     1   5 use DS::TypeSpec::Any;
  1         1  
  1         190  
23            
24             our ($VERSION) = $DS::VERSION;
25             our ($REVISION) = '$Revision: 1.1 $' =~ /(\d+\.\d+)/;
26             our ($STATE) = '$State: Exp $' =~ /:\s+(.+\S)\s+\$$/;
27            
28             sub new {
29 1     1 1 2 my( $class, $sub, $in_type, $source ) = @_;
30 1         7 my $self = $class->SUPER::new( $in_type, $source );
31 1         3 $self->{sub} = $sub;
32 1         5 return $self;
33             }
34            
35             # Don't do anything when getting a row
36             sub receive_row {
37 13     13 1 17 my( $self, $row ) = @_;
38 13         13 &{$self->{sub}}( $self, $row );
  13         31  
39 13         24 return;
40             }
41            
42             1;