blib/lib/ExtUtils/XSpp/Node/Module.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 75.0% 3 / 4 totaltotal 96.3% 26 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/ExtUtils/XSpp/Plugin/feature/default_xs_typemap.pm ↑ Summary blib/lib/ExtUtils/XSpp.pm »
1 package ExtUtils::XSpp::Node::Module;
2 21 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 21 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 21 ▶use base 'ExtUtils::XSpp::Node';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 ExtUtils::XSpp::Node::Module - Node representing an XS++/XS MODULE declaration
9  
10 =head1 DESCRIPTION
11  
12 An L<ExtUtils::XSpp::Node> subclass representing a module declaration.
13 For example, this XS++
14  
15 %module{Some::Perl::Namespace}
16  
17 would turn into this XS:
18  
19 MODULE=Some::Perl::Namespace
20  
21 See also: L<ExtUtils::XSpp::Node::Package>.
22  
23 In a nutshell, the module that your XS++/XS code belongs to is
24 the main Perl package of your wrapper. A single module can (and usually does)
25 have several packages (respectively C++ classes).
26  
27 =head1 METHODS
28  
29 =head2 new
30  
31 Creates a new C<ExtUtils::XSpp::Node::Module>.
32  
33 Named parameters: C<module> indicating the name
34 of the module.
35  
36 =cut
37  
38 82 ▶sub init {
Subroutine init: called CC=1 SCAR=0.0
Pod documented
39 82 my $this = shift;
40 82 my %args = @_;
41  
42 82 $this->{MODULE} = $args{module};
43 }
44  
45 163 ▶sub to_string { 'MODULE=' . $_[0]->module }
Subroutine to_string: called CC=1 SCAR=0.0
Pod undocumented
46  
47 82 ▶sub print { return $_[0]->to_string . "\n\n" }
Subroutine print: called CC=1 SCAR=0.0
Pod documented
48  
49 =head1 ACCESSORS
50  
51 =head2 module
52  
53 Returns the name of the module.
54  
55 =cut
56  
57 163 ▶sub module { $_[0]->{MODULE} }
Subroutine module: called CC=1 SCAR=0.0
Pod documented
58  
59 21 1;
« blib/lib/ExtUtils/XSpp/Plugin/feature/default_xs_typemap.pm ↑ Summary blib/lib/ExtUtils/XSpp.pm »