File Coverage

blib/lib/App/Tangerine/Metadata.pm
Criterion Covered Total %
statement 12 24 50.0
branch 0 2 0.0
condition n/a
subroutine 4 13 30.7
pod 0 7 0.0
total 16 46 34.7


line stmt bran cond sub pod time code
1             package App::Tangerine::Metadata;
2             $App::Tangerine::Metadata::VERSION = '0.21';
3 1     1   4 use strict;
  1         1  
  1         29  
4 1     1   3 use warnings;
  1         2  
  1         30  
5             use overload
6             '""' => sub {
7 1     1   3 no warnings 'uninitialized';
  1         1  
  1         133  
8 0     0     return $_[0]->type."\0".$_[0]->name."\0".$_[0]->version."\0".$_[0]->file
9             },
10             'cmp' => sub {
11 0     0     my ($self, $other) = @_;
12 0           return "$self" cmp "$other"
13 1     1   5 };
  1         1  
  1         11  
14              
15              
16             sub new {
17 0     0 0   my $class = shift;
18 0           my %args = @_;
19 0           bless { %args }, $class
20             }
21              
22             sub accessor {
23 0 0   0 0   $_[1]->{$_[0]} = $_[2] ? $_[2] : $_[1]->{$_[0]}
24             }
25              
26 0     0 0   sub name { accessor(name => @_) }
27 0     0 0   sub file { accessor(file => @_) }
28 0     0 0   sub type { accessor(type => @_) }
29 0     0 0   sub line { accessor(line => @_) }
30 0     0 0   sub version { accessor(version => @_) }
31              
32             1;
33              
34             __END__