File Coverage

blib/lib/Class/Plain/Base.pm
Criterion Covered Total %
statement 10 10 100.0
branch 2 2 100.0
condition 1 3 33.3
subroutine 3 3 100.0
pod 1 1 100.0
total 17 19 89.4


line stmt bran cond sub pod time code
1             package Class::Plain::Base;
2              
3 7     7   43 use strict;
  7         11  
  7         171  
4 7     7   32 use warnings;
  7         11  
  7         524  
5              
6             sub new {
7 23     23 1 25015 my $class = shift;
8            
9 23 100       76 my $self = ref $_[0] ? {%{$_[0]}} : {@_};
  1         4  
10            
11 23   33     109 bless $self, ref $class || $class;
12             }
13              
14             1;
15              
16             =encoding UTF-8
17              
18             =head1 Name
19              
20             C - Provide Constructor
21              
22             =head1 Description
23              
24             This module provides a constructor C.
25              
26             =head1 Class Methods
27              
28             =head2 new
29              
30             my $object = Class::Plain::Base->new(%args);
31            
32             my $object = Class::Plain::Base->new(\%args);
33              
34             Create a new object. The implementation is the following.
35              
36             sub new {
37             my $class = shift;
38            
39             my $self = ref $_[0] ? {%{$_[0]}} : {@_};
40            
41             bless $self, ref $class || $class;
42             }