Topiary/Base.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
new
1.0
CRAP 1.0
« Topiary.pm ↑ Summary
1 package Parse::RecDescent::Topiary::Base;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = 0.03;
6  
7 =head1 NAME
8  
9 Parse::RecDescent::Topiary::Base - Base class for autotree constructors
10  
11 =head1 SYNOPSIS
12  
13 package MyTree::Rule1;
14 use base 'Parse::RecDescent::Topiary::Base';
15  
16 =head1 DESCRIPTION
17  
18 This module provides a method C<new> to build hashref objects for autotree
19 classes. See L<Parse::RecDescent::Topiary> for details.
20  
21 =head2 new
22  
23 Basic hashref style object constructor. Takes a list of value pairs.
24  
25 =head1 BUGS
26  
27 Please report bugs to http://rt.cpan.org
28  
29 =head1 AUTHOR
30  
31 Ivor Williams
32 CPAN ID: IVORW
33
34 ivorw@cpan.org
35
36  
37 =head1 COPYRIGHT
38  
39 This program is free software; you can redistribute
40 it and/or modify it under the same terms as Perl itself.
41  
42 The full text of the license can be found in the
43 LICENSE file included with this module.
44  
45  
46 =head1 SEE ALSO
47  
48 L<Parse::RecDescent>, L<Parse::RecDescent::Topiary>.
49  
50 =cut
51  
52 21 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
53 21 my ( $pkg, %proto ) = @_;
54  
55 21 delete $proto{__RULE__}; #This information is already in the class name
56 21 bless \%proto, $pkg;
57 }
58  
59 2 1;
60  
61 # The preceding line will help the module return a true value
62  
« Topiary.pm ↑ Summary