File Coverage

lib/AI/Prolog/TermList/Primitive.pm
Criterion Covered Total %
statement 15 15 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 22 26 84.6


line stmt bran cond sub pod time code
1             package AI::Prolog::TermList::Primitive;
2             $REVISION = '$Id: Primitive.pm,v 1.2 2005/02/20 18:27:55 ovid Exp $';
3             $VERSION = '0.1';
4             @ISA = 'AI::Prolog::TermList';
5 13     13   30485 use strict;
  13         27  
  13         491  
6 13     13   70 use warnings;
  13         37  
  13         408  
7 13     13   81 use Scalar::Util qw/looks_like_number/;
  13         22  
  13         2333  
8              
9             sub new {
10 235     235 0 1775 my ($class, $number) = @_;
11 235         987 my $self = $class->SUPER::new; # correct?
12 235 50       958 $self->{ID} = looks_like_number($number) ? $number : 0;
13 235         655 return $self;
14             }
15              
16 49     49 0 242 sub ID { shift->{ID} }
17              
18 1     1 0 14 sub to_string { " <".shift->{ID}."> " }
19              
20             1;
21              
22             __END__