File Coverage

blib/lib/Net/Braintree/AdvancedSearch.pm
Criterion Covered Total %
statement 9 16 56.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 23 52.1


line stmt bran cond sub pod time code
1             package Net::Braintree::AdvancedSearch;
2              
3 1     1   3 use strict;
  1         2  
  1         26  
4 1     1   4 use vars qw(@ISA @EXPORT_OK);
  1         2  
  1         47  
5 1     1   3 use Exporter;
  1         2  
  1         132  
6             our @ISA = qw(Exporter);
7             our @EXPORT_OK = qw(search_to_hash);
8              
9             sub search_to_hash {
10 0     0 0   my ($self,$search) = @_;
11 0           my $hash = {};
12 0           for my $attribute ($search->meta()->get_all_attributes) {
13 0           my $field = $attribute->name;
14 0 0         if ($search->$field->active()) {
15 0           $hash->{$field} = $search->$field->criteria;
16             }
17             }
18 0           return $hash;
19             }
20              
21             1;