WSST::SchemaParser::YAML - YAML SchemaParser class of WSST


WSST documentation Contained in the WSST distribution.

Index


Code Index:

NAME

Top

WSST::SchemaParser::YAML - YAML SchemaParser class of WSST

DESCRIPTION

Top

This class is YAML schema parser.

METHODS

Top

new

Constructor.

types

Returns [".yml", ".yaml"]

parse

Parses YAML schema file, and returns Schema object.

SEE ALSO

Top

http://code.google.com/p/wsst/

AUTHORS

Top

Mitsuhisa Oshikawa <mitsuhisa [at] gmail.com> Yusuke Kawasaki <u-suke [at] kawa.net>

COPYRIGHT AND LICENSE

Top


WSST documentation Contained in the WSST distribution.

package WSST::SchemaParser::YAML;

use strict;
use base qw(WSST::SchemaParser);
use YAML ();

our $VERSION = '0.1.1';

sub new {
    my $class = shift;
    my $self = {};
    return bless($self, $class);
}

sub types {
    return [".yml", ".yaml"];
}

sub parse {
    my $self = shift;
    my $path = shift;
    
    my $data = YAML::LoadFile($path);
    
    return WSST::Schema->new($data);
}

1;