File Coverage

blib/lib/File/Extract/Result.pm
Criterion Covered Total %
statement 16 17 94.1
branch 2 2 100.0
condition n/a
subroutine 6 7 85.7
pod 5 5 100.0
total 29 31 93.5


line stmt bran cond sub pod time code
1             # $Id: /mirror/perl/File-Extract/trunk/lib/File/Extract/Result.pm 4210 2007-10-27T13:43:07.499967Z daisuke $
2             #
3             # Copyright (c) 2005 Daisuke Maki
4             # All rights reserved.
5              
6             package File::Extract::Result;
7 2     2   12 use strict;
  2         5  
  2         489  
8              
9             sub new
10             {
11 1     1 1 10 my $class = shift;
12 1         21 my %args = @_;
13 1         9 my $self = bless {%args}, $class;
14 1         140 return $self;
15             }
16              
17             sub _elem
18             {
19 3     3   8 my $self = shift;
20 3         11 my $field = shift;
21 3         6 my $old = $self->{$field};
22 3 100       9 if (@_) {
23 2         5 $self->{$field} = shift;
24             }
25 3         18 return $old;
26             }
27 1     1 1 5 sub mime_type { shift->_elem('mime_type', @_) }
28 1     1 1 1100 sub text { shift->_elem('text', @_) }
29 0     0 1 0 sub metadata { shift->_elem('metadata', @_) }
30 1     1 1 11 sub filename { shift->_elem('filename', @_) }
31              
32             1;
33              
34             __END__