X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FText%2FTradition.pm;h=ce64e1dd307c7f434f3b3c4fdbc2dc747918b5c2;hb=9a7df25a0901fa0a67fed374e6051f0f85fed3a2;hp=ef50df6d196d3f51baabeb83f1009479cf0ac6d7;hpb=f54b1ba72a1195818f413fc316cdd5e4a2b1d9b5;p=scpubgit%2Fstemmatology.git diff --git a/lib/Text/Tradition.pm b/lib/Text/Tradition.pm index ef50df6..ce64e1d 100644 --- a/lib/Text/Tradition.pm +++ b/lib/Text/Tradition.pm @@ -6,6 +6,7 @@ use Moose; use Text::Tradition::Collation; use Text::Tradition::Stemma; use Text::Tradition::Witness; +use Text::Tradition::User; use vars qw( $VERSION ); $VERSION = "0.5"; @@ -53,14 +54,29 @@ has 'stemmata' => ( }, default => sub { [] }, ); + +has '_initialized' => ( + is => 'ro', + isa => 'Bool', + default => undef, + writer => '_init_done', + ); has 'user' => ( is => 'rw', isa => 'Text::Tradition::User', required => 0, predicate => 'has_user', + clearer => 'clear_user', ); - + +has 'public' => ( + is => 'rw', + isa => 'Bool', + required => 0, + default => sub { 0; }, + ); + # Create the witness before trying to add it around 'add_witness' => sub { my $orig = shift; @@ -295,6 +311,7 @@ sub BUILD { $mod->can('parse')->( $self, $init_args ); } } + $self->_init_done( 1 ); return $self; }