File Coverage

blib/lib/Rope/Role.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Rope::Role;
2 3     3   219324 use strict;
  3         7  
  3         125  
3 3     3   17 use warnings;
  3         17  
  3         289  
4              
5 3     3   1364 use Rope no_import => 1;
  3         8  
  3         21  
6              
7             sub import {
8 3     3   36 my ($pkg, $caller) = (shift, scalar(caller));
9 3         20 Rope->import(caller => $caller, import => [qw/function property properties prototyped before around after requires/]);
10             }
11              
12             1;
13              
14             =head1 NAME
15              
16             Rope::Autoload - Rope Roles!
17              
18             =head1 VERSION
19              
20             Version 0.44
21              
22             =cut
23              
24             =head1 SYNOPSIS
25              
26             Quick summary of what the module does.
27              
28             Perhaps a little code snippet.
29              
30             package Knot::Role;
31              
32             use Rope::Role;
33              
34             requires qw/add_loops/;
35              
36             prototyped (
37             loops => 1,
38             hitches => 10,
39             ...
40              
41             );
42              
43             properties {
44             bends => {
45             type => sub { $_[0] =~ m/^\d+$/ ? $_[0] : die "$_[0] != integer" },
46             value => 10,
47             writeable => 0,
48             configurable => 1,
49             enumerable => 1,
50             },
51             ...
52             };
53              
54              
55             1;
56              
57             ...
58            
59             package Knot;
60              
61             use Rope;
62             use Rope::Autoload;
63              
64             with 'Knot::Role';
65              
66             requires qw/loops hitches bends/;
67              
68             function add_loops => sub {
69             my ($self, $loop) = @_;
70             $self->loops += $loop;
71             };
72              
73             1;
74              
75             ...
76              
77             my $k = Knot->new();
78              
79             say $k->loops; # 1;
80              
81             $k->add_loops(5);
82              
83             say $k->loops; # 6;
84              
85             $k->hitches = 15;
86            
87             $k->add_loops = 5; # errors
88              
89              
90             =head1 AUTHOR
91              
92             LNATION, C<< >>
93              
94             =head1 BUGS
95              
96             Please report any bugs or feature requests to C, or through
97             the web interface at L. I will be notified, and then you'll
98             automatically be notified of progress on your bug as I make changes.
99              
100             =head1 SUPPORT
101              
102             You can find documentation for this module with the perldoc command.
103              
104             perldoc Rope
105              
106             You can also look for information at:
107              
108             =over 4
109              
110             =item * RT: CPAN's request tracker (report bugs here)
111              
112             L
113              
114             =item * CPAN Ratings
115              
116             L
117              
118             =item * Search CPAN
119              
120             L
121              
122             =back
123              
124             =head1 ACKNOWLEDGEMENTS
125              
126             =head1 LICENSE AND COPYRIGHT
127              
128             This software is Copyright (c) 2023 by LNATION.
129              
130             This is free software, licensed under:
131              
132             The Artistic License 2.0 (GPL Compatible)
133              
134             =cut
135              
136             1; # End of Rope::Autoload