File Coverage

blib/lib/PerlX/Generator/Object.pm
Criterion Covered Total %
statement 20 23 86.9
branch n/a
condition n/a
subroutine 8 9 88.8
pod 0 2 0.0
total 28 34 82.3


line stmt bran cond sub pod time code
1             package PerlX::Generator::Object;
2              
3 1     1   5 use strictures 2;
  1         5  
  1         28  
4 1     1   529 use Lexical::Context;
  1         3  
  1         354  
5 1     1   461 use PerlX::Generator::Invocation;
  1         3  
  1         31  
6 1     1   6 use Moo;
  1         1  
  1         4  
7              
8 1     1   359 use overload '&{}' => sub { my $self = shift; sub { $self->start(@_) } };
  1     0   24  
  1         10  
  0         0  
  0         0  
  0         0  
9              
10             has code => (is => 'ro', required => 1);
11              
12             has lexical_context => (is => 'lazy', builder => sub {
13 1     1   10 my ($self) = @_;
14 1         7 return Lexical::Context->new(code => $self->code);
15             });
16              
17 1     1 0 20 sub invocation_class { 'PerlX::Generator::Invocation' }
18              
19             sub start {
20 1     1 0 1185 my ($self, @args) = @_;
21 1         4 return $self->invocation_class->new(
22             code => $self->code,
23             lexical_context => $self->lexical_context,
24             start_args => \@args
25             );
26             }
27              
28             1;