view lib/IMPL/Test/Result.pm @ 414:ec6f2d389d1e ref20150831

working on IMPL::Config::Bag
author cin
date Fri, 02 Oct 2015 06:56:24 +0300
parents 9335cf010b23
children
line wrap: on
line source

package IMPL::Test::Result;
use strict;
use warnings;

use IMPL::Const qw(:prop);
use IMPL::declare {
	base => [
		'IMPL::Object' => undef,
		'IMPL::Object::Serializable' => '@_'
	],
	props => [
		name => PROP_RW,
		state => PROP_RW,
		exception => PROP_RW,
		timeExclusive => PROP_RW,
		timeInclusive => PROP_RW
	]
};

__PACKAGE__->PassThroughArgs;

use constant {
    SUCCESS => 0,
    FAIL => 1,
    ERROR => 2
};

sub CTOR {
    my $this = shift;
    
    my $fields = @_ == 1 ? $_[0] : {@_};
    
    $fields->{timeExclusive} ||= 0;
    $fields->{timeInclusive} ||= 0;
    
    while (my ($k,$v) = each %$fields) {
    	$this->$k($v);
    }
}


1;