Acme-BloodType
view release on metacpan or search on metacpan
lib/Acme/BloodType.pm view on Meta::CPAN
distributions.
=cut
sub new {
my ($class, $init) = @_;
my $self = {};
if (defined $init && defined $init->{'genotype'}) {
return undef unless $geno_pheno->{ $init->{'genotype'} };
$self->{'genotype'} = $init->{'genotype'};
} elsif (defined $init && defined $init->{'phenotype'}) {
my @possible = grep { $geno_pheno->{$_} eq $init->{'phenotype'} } keys %$geno_pheno;
return undef unless @possible;
$self->{'genotype'} = $possible[rand @possible];
} else {
my @possible = keys %$geno_pheno;
$self->{'genotype'} = $possible[rand @possible];
}
return bless $self, $class;
}
=head2 $bt->get_bloodtype
( run in 1.416 second using v1.01-cache-2.11-cpan-d80b1682f3f )