File Coverage

blib/lib/Evo/Class/Attrs/XS.pm
Criterion Covered Total %
statement 24 24 100.0
branch 2 4 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 31 34 91.1


line stmt bran cond sub pod time code
1             package Evo::Class::Attrs::XS;
2 4     4   146611 use Evo 'XSLoader';
  4         4  
  4         17  
3 4     4   2186 use parent 'Evo::Class::Attrs::PP';
  4         909  
  4         16  
4              
5 4     4   11054 use Evo '-Export; Carp croak confess';
  4         6  
  4         11  
6 4         735 use constant {ECA_SIMPLE => 0, ECA_DEFAULT => 1, ECA_DEFAULT_CODE => 2, ECA_REQUIRED => 3,
7 4     4   115 ECA_LAZY => 4,};
  4         4  
8              
9             export qw(
10             ECA_SIMPLE ECA_DEFAULT ECA_DEFAULT_CODE ECA_REQUIRED ECA_LAZY
11             );
12              
13             our $VERSION = '0.006'; # VERSION
14              
15             # to be able to run with and without dzil
16             my $version = eval '$VERSION'; ## no critic
17             $version ? XSLoader::load("Evo::Class::Attrs::XS", $version) : XSLoader::load("Evo::Class::Attrs::XS");
18              
19 31 50   31 0 20420 sub gen_attr ($self, $name, $type, $value, $check, $ro, $inject) {
  31 50       59  
  31         33  
  31         32  
  31         24  
  31         29  
  31         26  
  31         23  
  31         24  
  31         21  
20 31         185 my $slot_ref = $self->_reg_attr($name, $type, $value, $check, $ro, $inject);
21 31         142 $self->_gen_attr($slot_ref);
22             }
23              
24              
25             1;
26              
27             # ABSTRACT: XS implementation of attributes and "new" method generator
28              
29             __END__