File Coverage

blib/lib/Evo/Class/Attrs/XS.pm
Criterion Covered Total %
statement 13 13 100.0
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 0 2 0.0
total 19 23 82.6


line stmt bran cond sub pod time code
1             package Evo::Class::Attrs::XS;
2 41     41   278 use Evo 'XSLoader; -Export';
  41         90  
  41         387  
3              
4 41         11722 use constant {ECA_OPTIONAL => 0, ECA_DEFAULT => 1, ECA_DEFAULT_CODE => 2, ECA_REQUIRED => 3,
5 41     41   359 ECA_LAZY => 4,};
  41         93  
6              
7             export qw(
8             ECA_OPTIONAL ECA_DEFAULT ECA_DEFAULT_CODE ECA_REQUIRED ECA_LAZY
9             );
10              
11             our $VERSION = '0.0404'; # VERSION
12              
13             # to be able to run with and without dzil
14             my $version = eval '$VERSION'; ## no critic
15             $version
16             ? XSLoader::load("Evo::Class::Attrs::XS", $version)
17             : XSLoader::load("Evo::Class::Attrs::XS");
18              
19 211     211 0 7128 sub new { bless [], shift }
20              
21 507 50   507 0 1701 sub gen_attr ($self, %opts) {
  507 50       1317  
  507         873  
  507         2508  
  507         1029  
22 507         4898 $self->_gen_attr(@opts{qw(name type value check ro inject method)});
23             }
24              
25             1;
26              
27             # ABSTRACT: XS implementation of attributes and "new" method generator
28              
29             __END__