Punchcard/Attributes.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 2 SCAR 12.8
CC
2
Cov
0%
import
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 use Renard::Incunabula::Common::Setup;
2 package Intertangle::Punchcard::Attributes;
3 # ABSTRACT: Attributes for constraint variables
4 $Intertangle::Punchcard::Attributes::VERSION = '0.002';
5 use Moo::_Utils qw(_install_coderef);
6 use Intertangle::Punchcard::Backend::Kiwisolver::Symbolic;
7  
8 sub import {
9 my $target = caller;
10 my $has = $target->can( "has" ) or die "Moo not loaded in caller: $target";
11 _install_coderef $target. "::variable" => my $variable = sub {
12 my ($name, @args) = @_;
13 $has->($name,
14 is => 'lazy',
15 builder => sub {
16 Intertangle::Punchcard::Backend::Kiwisolver::Symbolic->new( name => $name );
17 },
18 @args,
19 );
20 };
21  
22 if (my $info = $Role::Tiny::INFO{$target}) {
23 $info->{not_methods}{$variable} = $variable;
24 }
25  
26 undef;
27 }
28  
29 1;
30  
31 __END__