File Coverage

blib/lib/DBomb/Query/Text.pm
Criterion Covered Total %
statement 21 25 84.0
branch 1 2 50.0
condition n/a
subroutine 6 7 85.7
pod 1 2 50.0
total 29 36 80.5


line stmt bran cond sub pod time code
1             package DBomb::Query::Text;
2              
3             =head1 NAME
4              
5             DBomb::Query::Text - Just a wrapper around plain sql.
6              
7             =cut
8              
9 12     12   65 use strict;
  12         23  
  12         524  
10 12     12   60 use warnings;
  12         23  
  12         682  
11             our $VERSION = '$Revision: 1.6 $';
12              
13 12     12   68 use Carp::Assert;
  12         29  
  12         71  
14 12     12   2353 use DBomb::Util qw(ctx_0);
  12         19  
  12         963  
15             use Class::MethodMaker
16 12         116 'new_with_init' => 'new',
17             'get_set' => [qw(text bind_values)],
18 12     12   26655 ;
  12         346179  
19              
20             sub init
21             {
22 6     6 0 61 my ($self, $text, @bind_values) = @_;
23              
24 6         26 assert(UNIVERSAL::isa($self,__PACKAGE__));
25 6         26 assert(defined($text),'valid parameters');
26              
27 6         196 $self->text($text);
28 6         231 $self->bind_values([]);
29 6 50       221 push @{$self->bind_values},@bind_values if @bind_values;
  0            
30             }
31              
32             sub sql
33             {
34 0     0 1   my ($self, $dbh) = @_;
35 0           return ctx_0($self->text, @{$self->bind_values});
  0            
36             }
37              
38              
39             1;
40             __END__