blib/lib/Class/DBI/Plugin/AccessionSearch.pm

filter: Statementstmt 50.0% 17 / 34 Branchbran n/a Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 43.6% 24 / 55 CC 5 SCAR 26.6
CC
5
Cov
40%
accession_search
30.0
accession
2.0
BEGIN
1.0
CRAP 14.3
↑ Summary
1 package Class::DBI::Plugin::AccessionSearch;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base qw/Class::DBI::Plugin/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.02';
7  
8 0 ▶sub accession : Plugged {
Subroutine accession: not called CC=1 SCAR=6.9
Pod documented
9 0 my($pkg, $where, $attrs) = @_;
10  
11 0 my $param = {
12 pkg => $pkg,
13 where => $where,
14 attrs => $attrs,
15 };
16  
17 0 bless $param , __PACKAGE__;
18 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub accession_search : Plugged {
Subroutine accession_search: not called CC=5 SCAR=34.0
Pod documented
21 0 my ($self, $where, $attrs) = @_;
22  
23 0 ▶ $where ||= {};
Condition0%0/2
$where ||= {}
l!l
00
MC/DC0%0/1
$where ||= {}
$where
Truth table0%0/2
A
A= $where
Aresult
11
00
24 0 ▶ $attrs ||= {};
Condition0%0/2
$attrs ||= {}
l!l
00
MC/DC0%0/1
$attrs ||= {}
$attrs
Truth table0%0/2
A
A= $attrs
Aresult
11
00
25  
26 0 ▶ my $our_where = $self->{where} || {};
Condition0%0/2
$self->{'where'} || {}
l!l
00
MC/DC0%0/1
$self->{'where'} || {}
$self->{'where'}
Truth table0%0/2
A
A= $self->{'where'}
Aresult
11
00
27 0 my $new_where = { %{$our_where} , %{$where} };
28  
29 0 ▶ my $our_atters = $self->{attrs} || {};
Condition0%0/2
$self->{'attrs'} || {}
l!l
00
MC/DC0%0/1
$self->{'attrs'} || {}
$self->{'attrs'}
Truth table0%0/2
A
A= $self->{'attrs'}
Aresult
11
00
30 0 my $new_attrs = { %{$our_atters} , %{$attrs} };
31  
32 0 $self->{where} = $new_where;
33 0 $self->{attrs} = $new_attrs;
34  
35 0 return $self->{pkg}->search_where($new_where,$new_attrs);
36 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 =head1 NAME
39  
40 Class::DBI::Plugin::AccessionSearch - easliy add search atters.
41  
42 =head1 VERSION
43  
44 This documentation refers to Class::DBI::Plugin::AccessionSearch version 0.02
45  
46 =head1 SYNOPSIS
47  
48  
49 package Your::Data;
50 use base 'Class::DBI';
51 use Class::DBI::AccessionSearch;
52  
53 in your script:
54  
55 use Your::Data;
56 my $d = Your::Data->accession({status => 'ok'});
57 $d->accession_search({sex => 'male'});
58 $d->accession_search({status => 'ng'});
59  
60 =head1 Methods
61  
62 =head2 accession
63  
64 create Class::DBI::AccessionSearch object.
65  
66 =head2 accession_search
67  
68 search_where's wrapper.
69  
70 =head1 AUTHOR
71  
72 Atsushi Kobayashi, C<< <nekokak at gmail.com> >>
73  
74 =head1 BUGS
75  
76 Please report any bugs or feature requests to
77 C<bug-class-dbi-plugin-accessionsearch at rt.cpan.org>, or through the web interface at
78 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-DBI-Plugin-AccessionSearch>.
79 I will be notified, and then you'll automatically be notified of progress on
80 your bug as I make changes.
81  
82 =head1 SUPPORT
83  
84 You can find documentation for this module with the perldoc command.
85  
86 perldoc Class::DBI::Plugin::AccessionSearch
87  
88 You can also look for information at:
89  
90 =over 4
91  
92 =item * AnnoCPAN: Annotated CPAN documentation
93  
94 L<http://annocpan.org/dist/Class-DBI-Plugin-AccessionSearch>
95  
96 =item * CPAN Ratings
97  
98 L<http://cpanratings.perl.org/d/Class-DBI-Plugin-AccessionSearch>
99  
100 =item * RT: CPAN's request tracker
101  
102 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Class-DBI-Plugin-AccessionSearch>
103  
104 =item * Search CPAN
105  
106 L<http://search.cpan.org/dist/Class-DBI-Plugin-AccessionSearch>
107  
108 =back
109  
110 =head1 ACKNOWLEDGEMENTS
111  
112 =head1 COPYRIGHT & LICENSE
113  
114 Copyright 2006 Atsushi Kobayashi, all rights reserved.
115  
116 This program is free software; you can redistribute it and/or modify it
117 under the same terms as Perl itself.
118  
119 =cut
120  
121 2 1; # End of Class::DBI::Plugin::AccessionSearch
↑ Summary