| 1 | package Markdent::Handler::CaptureEvents; | ||
| 2 | |||
| 3 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 2 | our $VERSION = '0.39'; | |
| 8 | |||
| 9 | 2 | ▶ | use Markdent::CapturedEvents; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use Specio::Declare; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 2 | ▶ | use MooseX::StrictConstructor; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 2 | with 'Markdent::Role::Handler'; | |
| 16 | |||
| 17 | has captured_events => ( | ||
| 18 | is => 'ro', | ||
| 19 | isa => object_isa_type('Markdent::CapturedEvents'), | ||
| 20 | init_arg => undef, | ||
| 21 | 1 | ▶ | default => sub { Markdent::CapturedEvents->new }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 22 | 2 | ); | |
| 23 | |||
| 24 | sub handle_event { | ||
| 25 | 264 | ▶ | $_[0]->captured_events->capture_events( $_[1] ); |
|
Subroutine
handle_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 26 | } | ||
| 27 | |||
| 28 | 2 | __PACKAGE__->meta->make_immutable; | |
| 29 | |||
| 30 | 2 | 1; | |
| 31 | |||
| 32 | # ABSTRACT: Captures events for replaying later | ||
| 33 | |||
| 34 | __END__ | ||
| 35 | |||
| 36 | =pod | ||
| 37 | |||
| 38 | =encoding UTF-8 | ||
| 39 | |||
| 40 | =head1 NAME | ||
| 41 | |||
| 42 | Markdent::Handler::CaptureEvents - Captures events for replaying later | ||
| 43 | |||
| 44 | =head1 VERSION | ||
| 45 | |||
| 46 | version 0.39 | ||
| 47 | |||
| 48 | =head1 DESCRIPTION | ||
| 49 | |||
| 50 | This class implements an event receiver which simply captures events using | ||
| 51 | L<Markdent::CapturedEvents>. This can be used as a way to cache the results of | ||
| 52 | parsing at an intermediate stage. | ||
| 53 | |||
| 54 | =head1 METHODS | ||
| 55 | |||
| 56 | This class provides the following methods: | ||
| 57 | |||
| 58 | =head2 Markdent::Handler::CapturedEvents->new | ||
| 59 | |||
| 60 | This method creates a new handler. | ||
| 61 | |||
| 62 | =head2 $mhce->captured_events | ||
| 63 | |||
| 64 | Returns a L<Markdent::CapturedEvents> object containing all the events seen by | ||
| 65 | this handler so far. | ||
| 66 | |||
| 67 | =head1 ROLES | ||
| 68 | |||
| 69 | This class does the L<Markdent::Role::Handler> role. | ||
| 70 | |||
| 71 | =head1 BUGS | ||
| 72 | |||
| 73 | See L<Markdent> for bug reporting details. | ||
| 74 | |||
| 75 | Bugs may be submitted at L<https://github.com/houseabsolute/Markdent/issues>. | ||
| 76 | |||
| 77 | I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>. | ||
| 78 | |||
| 79 | =head1 SOURCE | ||
| 80 | |||
| 81 | The source code repository for Markdent can be found at L<https://github.com/houseabsolute/Markdent>. | ||
| 82 | |||
| 83 | =head1 AUTHOR | ||
| 84 | |||
| 85 | Dave Rolsky <autarch@urth.org> | ||
| 86 | |||
| 87 | =head1 COPYRIGHT AND LICENSE | ||
| 88 | |||
| 89 | This software is copyright (c) 2021 by Dave Rolsky. | ||
| 90 | |||
| 91 | This is free software; you can redistribute it and/or modify it under | ||
| 92 | the same terms as the Perl 5 programming language system itself. | ||
| 93 | |||
| 94 | The full text of the license can be found in the | ||
| 95 | F<LICENSE> file included with this distribution. | ||
| 96 | |||
| 97 | =cut | ||