藤 吾郎
and 1 contributors

NAME

MouseX::YAML - DWIM loading of Mouse objects from YAML

VERSION

This document describes MouseX::YAML version 0.001.

SYNOPSIS

    # given some class:
    package My::Module;
    use Mouse;

    has package => (
        is => "ro",
        init_arg => "name",
    );

    has version => (
        is  => "rw",
        init_arg => undef,
    );

    sub BUILD { shift->version(3) }

    # load an object like so:
    use MouseX::YAML qw(Load);

    my $obj = Load(<<'    YAML');
    --- !!perl/hash:My::Module
    name: "MouseX::YAML"
    YAML

    print $obj->package; # MouseX::YAML
    print $obj->version; # 3

DESCRIPTION

This module provides DWIM loading of Mouse based objects from YAML documents.

Any hashes blessed into a Mouse class will be replaced with a properly constructed instance (respecting init_arg and BUILD).

INTERFACE

Exportable functions

Load($yaml)

LoadFile($file)

Class methods

MouseX::YAML->backend()

MouseX::YAML->load($yaml)

MouseX::YAML->load_file($file)

DEPENDENCIES

Perl 5.8.1 or later.

BUGS

No bugs have been reported.

Please report any bugs or feature requests to the author.

AUTHOR

Goro Fuji (gfx) <gfuji(at)cpan.org>

SEE ALSO

Mouse

MooseX::YAML

LICENSE AND COPYRIGHT

Copyright (c) 2009, Goro Fuji (gfx). Some rights reserved.

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