Forest::Tree::Writer - An abstract role for tree writers


Forest documentation Contained in the Forest distribution.

Index


Code Index:

NAME

Top

Forest::Tree::Writer - An abstract role for tree writers

DESCRIPTION

Top

This is an abstract role for tree writers.

ATTRIBUTES

Top

tree

REQUIRED METHODS

Top

as_string

METHODS

Top

write ($fh)

BUGS

Top

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Top

Stevan Little <stevan.little@iinteractive.com>

COPYRIGHT AND LICENSE

Top


Forest documentation Contained in the Forest distribution.

package Forest::Tree::Writer;
use Moose::Role;

our $VERSION   = '0.09';
our $AUTHORITY = 'cpan:STEVAN';

has 'tree' => (
    is          => 'rw',
    isa         => 'Forest::Tree::Pure',
    required    => 1,
);

requires 'as_string';

sub write {
    my ($self, $fh) = @_;
    print $fh $self->as_string;
}

no Moose::Role; 1;

__END__