Skip to content

Commit

Permalink
Use parent_names class attribute, rather that hard coded 'Mother'
Browse files Browse the repository at this point in the history
  • Loading branch information
yewtc committed May 9, 2023
1 parent 6947428 commit aabf4d1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Genealogy/Ahnentafel.pm
Expand Up @@ -100,11 +100,13 @@ This function takes an array of strings, of the form

sub ahnen_parents {
my $ahnen = 1;
return $ahnen if @_ == 0;
my $mother = __PACKAGE__->parent_names->[1];
while ( my $parent = shift @_ ) {
$ahnen *= 2;
$ahnen += ( $parent =~ /Mother/i );
$ahnen += ( $parent =~ /$mother/i );
}
return Genealogy::Ahnentafel->new({ ahnentafel => $ahnen });
return Genealogy::Ahnentafel->new( { ahnentafel => $ahnen } );
}

=head1 CLASS ATTRIBUTES
Expand Down

0 comments on commit aabf4d1

Please sign in to comment.