Markdent/Handler/Multiplexer.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 96.9% 32 / 33 CC 2 SCAR 2.2
CC
2
Cov
100%
handle_event
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Markdent/Types/Internal.pm ↑ Summary Markdent/Handler/HTMLFilter.pm »
1 package Markdent::Handler::Multiplexer;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.39';
8  
9 1 ▶use Markdent::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 with 'Markdent::Role::Handler';
15  
16 1 has _handlers => (
17 is => 'ro',
18 isa => t( 'ArrayRef', of => t('HandlerObject') ),
19 init_arg => 'handlers',
20 required => 1,
21 );
22  
23 sub handle_event {
24 264 ▶ $_->handle_event( $_[1] ) for @{ $_[0]->_handlers };
Subroutine handle_event: called CC=2 SCAR=6.9
Pod undocumented
25 }
26  
27 1 __PACKAGE__->meta->make_immutable;
28  
29 1 1;
30  
31 # ABSTRACT: Passes events on to multiple handlers
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 Markdent::Handler::Multiplexer - Passes events on to multiple handlers
42  
43 =head1 VERSION
44  
45 version 0.39
46  
47 =head1 DESCRIPTION
48  
49 This class passes the event stream onto one or more handlers. This is handy if
50 you want to do multiple things with a document at once, for example generate
51 HTML and capture the events to save for a cache.
52  
53 =head1 METHODS
54  
55 This class provides the following methods:
56  
57 =head2 Markdent::Handler::Multiplexer->new( handlers => [ ... ] )
58  
59 This method creates a new handler. You must pass a list of one or more objects
60 which do the L<Markdent::Role::Handler> role as the "handlers" parameters.
61  
62 =head1 ROLES
63  
64 This class does the L<Markdent::Role::Handler> role.
65  
66 =head1 BUGS
67  
68 See L<Markdent> for bug reporting details.
69  
70 Bugs may be submitted at L<https://github.com/houseabsolute/Markdent/issues>.
71  
72 I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
73  
74 =head1 SOURCE
75  
76 The source code repository for Markdent can be found at L<https://github.com/houseabsolute/Markdent>.
77  
78 =head1 AUTHOR
79  
80 Dave Rolsky <autarch@urth.org>
81  
82 =head1 COPYRIGHT AND LICENSE
83  
84 This software is copyright (c) 2021 by Dave Rolsky.
85  
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88  
89 The full text of the license can be found in the
90 F<LICENSE> file included with this distribution.
91  
92 =cut
« Markdent/Types/Internal.pm ↑ Summary Markdent/Handler/HTMLFilter.pm »