accessors/chained.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« accessors/ro.pm ↑ Summary accessors/rw.pm »
1 =head1 NAME
2  
3 accessors::chained - create method chaining accessors in caller's package.
4  
5 =head1 SYNOPSIS
6  
7 package Foo;
8 use accessors::chained qw( foo bar baz );
9  
10 my $obj = bless {}, 'Foo';
11  
12 # generates chaining accessors:
13 $obj->foo( 'hello ' )
14 ->bar( 'world' )
15 ->baz( "!\n" );
16  
17 print $obj->foo, $obj->bar, $obj->baz;
18  
19 =cut
20  
21 package accessors::chained;
22  
23 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use base qw( accessors );
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 1 our $VERSION = '1.01';
28 1 our $REVISION = (split(/ /, ' $Revision: 1.3 $ '))[2];
29  
30 # inherit everything for now.
31  
32 1 1;
33  
34 __END__
« accessors/ro.pm ↑ Summary accessors/rw.pm »