Accessor method for the general witness description.
-=head2 path
+=head2 is_layered
-An array of Text::Tradition::Collation::Reading objects which, taken in
-sequence, represent the text.
-
-=head2 uncorrected_path
-
-An array of Text::Tradition::Collation::Reading objects which, taken in
-sequence, represent the text before any scribal corrections were made.
+Boolean method to note whether the witness has layers (e.g. pre-correction
+readings) in the collation.
=begin testing
predicate => 'has_source',
);
-# Path. This is an array of Reading nodes that should mirror the
-# text above.
+# Path. This is an array of Reading nodes that can be saved during
+# initialization, but should be cleared before saving in a DB.
has 'path' => (
is => 'rw',
isa => 'ArrayRef[Text::Tradition::Collation::Reading]',
predicate => 'has_path',
+ clearer => 'clear_path',
);
has 'uncorrected_path' => (
is => 'rw',
isa => 'ArrayRef[Text::Tradition::Collation::Reading]',
- predicate => 'has_ante_corr',
+ clearer => 'clear_uncorrected_path',
+ );
+
+has 'is_layered' => (
+ is => 'rw',
+ isa => 'Bool',
);
# Manuscript name or similar
isa => 'Str',
);
+# If we set an uncorrected path, ever, remember that we did so.
+around 'uncorrected_path' => sub {
+ my $orig = shift;
+ my $self = shift;
+
+ $self->is_layered( 1 );
+ $self->$orig( @_ );
+};
sub BUILD {
my $self = shift;
$self->$orig( @_ );
};
+
no Moose;
__PACKAGE__->meta->make_immutable;