File Coverage

blib/lib/Devel/Declare/Parser/Method.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Devel::Declare::Parser::Method;
2 2     2   28853 use strict;
  2         3  
  2         67  
3 2     2   8 use warnings;
  2         3  
  2         51  
4              
5 2     2   8 use base 'Devel::Declare::Parser::Sublike';
  2         3  
  2         526  
6 2     2   11 use Devel::Declare::Interface;
  2         3  
  2         196  
7             Devel::Declare::Interface::register_parser( 'method' );
8              
9 9     9 1 26 sub inject {('my $self = shift')}
10              
11             1;
12              
13             =head1 NAME
14              
15             Devel::Declare::Parser::Method - Parser that shifts $self automatically in
16             codeblocks.
17              
18             =head1 DESCRIPTION
19              
20             This parser can be used to define a function that takes a single name, and a
21             single codeblock. This is just like the 'sub' keyword. The name can be either a
22             bareword, or a quoted string.
23              
24             =head1 EXTRAS WHEN USING THE KEYWORD
25              
26             Codeblocks defined when using the keyword will have '$self' shifted off
27             automatically.
28              
29             =head1 AUTHORS
30              
31             Chad Granum L
32              
33             =head1 COPYRIGHT
34              
35             Copyright (C) 2010 Chad Granum
36              
37             Devel-Declare-Parser is free software; Standard perl licence.
38              
39             Devel-Declare-Parser is distributed in the hope that it will be useful, but
40             WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
41             FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.