some more rehoming of functionality
[scpubgit/stemmatology.git] / lib / Text / Tradition / Collation / Reading.pm
index 146eadf..e3d6d6d 100644 (file)
@@ -14,6 +14,7 @@ subtype 'Position'
 has 'position' => (
     is => 'rw',
     isa => 'Position',
+    predicate => 'has_position',
     );
 
 # This contains an array of reading objects; the array is a pool,
@@ -132,6 +133,21 @@ sub set_relationship {
     $self->relationships->{ $rel } = $value;
 }
 
+sub is_common {
+    my( $self ) = shift;
+    return $self->get_attribute( 'class' ) eq 'common';
+}
+
+sub make_common {
+    my( $self ) = shift;
+    $self->set_attribute( 'class', 'common' );
+}
+
+sub make_variant {
+    my( $self ) = shift;
+    $self->set_attribute( 'class', 'variant' );
+}
+
 no Moose;
 __PACKAGE__->meta->make_immutable;