The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MetaPOD::Assembler - Glue layer that dispatches segments to a constructed Result

VERSION

version 0.3.5

SYNOPSIS

    use MetaPOD::Assembler;

    my $assembler = MetaPOD::Assembler->new();

    for my $file ( @files ) {
        my $object = $assembler->assemble_file( $file );
    }

This, should be enough for the majority of use-cases.

At present, MetaPOD::Assembler only supports JSON specification out-of-the-box, but you can extend it to support any other defined specifications by replacing the format map

    my $assembler = MetaPOD::Assembler->new( format_map => {
        JSON => 'MetaPOD::Format::JSON',
        YAML => 'MyProject::Format::YAML',
    });

METHODS

assemble_handle

Wraps "assemble_handle" in Pod::Eventual and returns a MetaPOD::Result for each passed file handle

assemble_file

Wraps "assemble_file" in Pod::Eventual and returns a MetaPOD::Result for each passed file

assemble_string

Wraps "assemble_string" in Pod::Eventual and returns a MetaPOD::Result for each passed string

get_class_for_format

Gets the class to load for the specified format from the internal map, "format_map"

handle_segment

    $assembler->handle_segment( $segment_hash )

This is the callback point of entry that dispatches calls from the MetaPOD::Extractor, loads and calls the relevant Format ( via "get_class_for_format", validates that version specifications are supported ( via Format->supports_version($v) ) and then asks the given format to modify the current MetaPOD::Result object by parsing the given $segment_hash

ATTRIBUTES

result

extractor

format_map

AUTHOR

Kent Fredric <kentfredric@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Kent Fredric <kentfredric@gmail.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.