File Coverage

blib/lib/DWH_File/Subscript/Wired.pm
Criterion Covered Total %
statement 27 28 96.4
branch 1 2 50.0
condition 1 3 33.3
subroutine 9 10 90.0
pod 0 4 0.0
total 38 47 80.8


line stmt bran cond sub pod time code
1             package DWH_File::Subscript::Wired;
2              
3 9     9   47 use warnings;
  9         22  
  9         265  
4 9     9   45 use strict;
  9         19  
  9         271  
5 9     9   55 use vars qw( @ISA $VERSION );
  9         18  
  9         544  
6             use overload
7 9         139 '""' => \&to_string,
8 9     9   59 fallback => 1;
  9         16  
9              
10 9     9   689 use DWH_File::Subscript;
  9         15  
  9         62  
11 9     9   327 use DWH_File::Slot;
  9         21  
  9         55  
12              
13             @ISA = qw( DWH_File::Subscript DWH_File::Slot );
14             $VERSION = 0.01;
15              
16             sub new {
17 566     566 0 856 my ( $this, $owner, $value ) = @_;
18 566   33     1915 my $class = ref $this || $this;
19 566         1702 my $self = { owner => $owner,
20             value => $value,
21             };
22 566         1369 bless $self, $class;
23 566         1778 return $self;
24             }
25              
26             sub from_input {
27 558     558 0 1020 my ( $this, $owner, $actual ) = @_;
28 558 50       1277 defined $actual or $actual = '';
29             return $this->new( $owner, DWH_File::Value::Factory->
30 558         2073 from_input( $owner->{ kernel }, $actual ) );
31             }
32              
33             sub to_string {
34 663     663 0 16255 return pack( "L", $_[ 0 ]->{ owner }{ id } ) . $_[ 0 ]->{ value };
35             }
36              
37             sub actual {
38 0     0 0   return $_[ 0 ]->{ value }->actual_value;
39             }
40              
41             1;
42              
43             __END__