Markdent::Handler::Multiplexer - Passes events on to multiple handlers


Markdent documentation Contained in the Markdent distribution.

Index


Code Index:

NAME

Top

Markdent::Handler::Multiplexer - Passes events on to multiple handlers

VERSION

Top

version 0.17

DESCRIPTION

Top

This class passes the event stream onto one or more handlers. This is handy if you want to do multiple things with a document at once, for example generate HTML and capture the events to save for a cache.

METHODS

Top

This class provides the following methods:

Markdent::Handler::Multiplexer->new( handlers => [ ... ] )

This method creates a new handler. You must pass a list of one or more objects which do the Markdent::Role::Handler role as the "handlers" parameters.

ROLES

Top

This class does the Markdent::Role::Handler role.

BUGS

Top

See Markdent for bug reporting details.

AUTHOR

Top

Dave Rolsky <autarch@urth.org>

COPYRIGHT AND LICENSE

Top


Markdent documentation Contained in the Markdent distribution.

package Markdent::Handler::Multiplexer;
BEGIN {
  $Markdent::Handler::Multiplexer::VERSION = '0.17';
}

use strict;
use warnings;

use Markdent::Types qw( NonEmptyArrayRef HandlerObject );

use namespace::autoclean;
use Moose;
use MooseX::StrictConstructor;

with 'Markdent::Role::Handler';

has _handlers => (
    is       => 'ro',
    isa      => NonEmptyArrayRef[HandlerObject],
    init_arg => 'handlers',
    required => 1,
);

sub handle_event {
    $_->handle_event( $_[1] ) for @{ $_[0]->_handlers() };
}

__PACKAGE__->meta()->make_immutable();

1;

# ABSTRACT: Passes events on to multiple handlers




__END__