blib/lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod n/a totaltotal 97.1% 34 / 35 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Moose/Meta/Method/Accessor/Native/Array/first_index.pm ↑ Summary blib/lib/Class/MOP/Deprecated.pm »
1 package Moose::Meta::Method::Accessor::Native::Array::natatime;
2 4 our $VERSION = '2.4001';
3  
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 4 ▶use Params::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 with 'Moose::Meta::Method::Accessor::Native::Reader';
12  
13 19 ▶sub _minimum_arguments { 1 }
Subroutine _minimum_arguments: called CC=1 SCAR=0.0
14  
15 19 ▶sub _maximum_arguments { 2 }
Subroutine _maximum_arguments: called CC=1 SCAR=0.0
16  
17 19 ▶sub _inline_check_arguments {
Subroutine _inline_check_arguments: called CC=1 SCAR=0.0
18 19 my $self = shift;
19  
20 return (
21 19 'if (!defined($_[0]) || $_[0] !~ /^\d+$/) {',
22 $self->_inline_throw_exception( InvalidArgumentToMethod =>
23 'argument => $_[0],'.
24 'method_name => "natatime",'.
25 'type_of_argument => "integer",'.
26 'type => "Int",'.
27 'argument_noun => "n value"',
28 ) . ';',
29 '}',
30 'if (@_ == 2 && !Params::Util::_CODELIKE($_[1])) {',
31 $self->_inline_throw_exception( InvalidArgumentToMethod =>
32 'argument => $_[1],'.
33 'method_name => "natatime",'.
34 'type_of_argument => "code reference",'.
35 'type => "CodeRef",'.
36 'ordinal => "second"',
37 ) . ';',
38 '}',
39 );
40 }
41  
42 19 ▶sub _inline_return_value {
Subroutine _inline_return_value: called CC=1 SCAR=0.0
43 19 my $self = shift;
44 19 my ($slot_access) = @_;
45  
46 return (
47 19 'my $step = $_[0];',
48 'my @values = @{ (' . $slot_access . ') };',
49 'my $iter = sub { splice @values, 0, $step };',
50 'if ($_[1]) {',
51 'while (my @vals = $iter->()) {',
52 '$_[1]->(@vals);',
53 '}',
54 '}',
55 'else {',
56 'return $iter;',
57 '}',
58 );
59 }
60  
61 # Not called, but needed to satisfy the Reader role
62 0 ▶sub _return_value { }
Subroutine _return_value: not called CC=1 SCAR=0.0
63  
64 4 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
65  
66 4 1;
« blib/lib/Moose/Meta/Method/Accessor/Native/Array/first_index.pm ↑ Summary blib/lib/Class/MOP/Deprecated.pm »