From: Tara L Andrews Date: Sat, 25 Aug 2012 11:34:47 +0000 (+0200) Subject: add solution status to Result object X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74038ae57789ea67cdfde7d216b62d6cd97ca23d;p=scpubgit%2Fstemmatology.git add solution status to Result object --- diff --git a/lib/Text/Tradition/Analysis/Result.pm b/lib/Text/Tradition/Analysis/Result.pm index 23db4d9..ba5c60b 100644 --- a/lib/Text/Tradition/Analysis/Result.pm +++ b/lib/Text/Tradition/Analysis/Result.pm @@ -68,6 +68,11 @@ has 'graph' => ( required => 1 ); +has 'status' => ( + is => 'rw', + isa => 'Str' +); + has 'is_genealogical' => ( is => 'rw', isa => 'Bool', @@ -126,6 +131,11 @@ around BUILDARGS => sub { die "Passed argument to graph that is neither Stemma nor Graph"; } } + + # If our only args are graph and setlist, then status should be 'new' + if( scalar keys %$args == 2 ) { + $args->{'status'} = 'new'; + } return $class->$orig( $args ); };