File Coverage

blib/lib/Bio/Polloc/GroupCriteria/operator/cons.pm
Criterion Covered Total %
statement 7 16 43.7
branch 0 4 0.0
condition n/a
subroutine 3 5 60.0
pod 2 2 100.0
total 12 27 44.4


line stmt bran cond sub pod time code
1             =head1 NAME
2              
3             Bio::Polloc::GroupCriteria::operator::cons - A constant
4              
5             =head1 AUTHOR - Luis M. Rodriguez-R
6              
7             Email lmrodriguezr at gmail dot com
8              
9             =cut
10              
11             package Bio::Polloc::GroupCriteria::operator::cons;
12 3     3   16 use base qw(Bio::Polloc::GroupCriteria::operator);
  3         5  
  3         227  
13 3     3   15 use strict;
  3         7  
  3         551  
14             our $VERSION = 1.0503; # [a-version] from Bio::Polloc::Polloc::Version
15              
16              
17             =head1 GLOBALS
18              
19             =head2 OP_CONS
20              
21             A hashref containing any eventual constant value.
22              
23             =cut
24              
25             our $OP_CONS = {};
26              
27             =head1 APPENDIX
28              
29             Methods provided by the package
30              
31             =head2 new
32              
33             Generic initialization method.
34              
35             =head3 Arguments
36              
37             See L<Bio::Polloc::GroupCriteria::operator->new()>
38              
39             =head3 Returns
40              
41             A L<Bio::Polloc::GroupCriteria::operator::bool> object.
42              
43             =cut
44              
45             sub new {
46 0     0 1 0 my($caller,@args) = @_;
47 0         0 my $self = $caller->SUPER::new(@args);
48 0         0 $self->_initialize(@args);
49 0         0 return $self;
50             }
51              
52             =head2 operate
53              
54             =head3 Returns
55              
56             A L<Bio::Seq> object.
57              
58             =cut
59              
60             sub operate {
61 0     0 1 0 my $self = shift;
62 0 0       0 return $self->val if defined $self->val;
63 0         0 my $out = $Bio::Polloc::GroupCriteria::operator::cons::OP_CONS->{$self->operation};
64 0 0       0 return $out if defined $out;
65 0         0 $self->throw("Unknown constant", $self->operation);
66             }
67              
68             =head1 INTERNAL METHODS
69              
70             Methods intended to be used only within the scope of Bio::Polloc::*
71              
72             =head2 _initialize
73              
74             =cut
75              
76 24     24   51 sub _initialize { }
77              
78             1;