line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
package WebService::Braintree::AdvancedSearchNodes; |
3
|
|
|
|
|
|
|
$WebService::Braintree::AdvancedSearchNodes::VERSION = '0.93'; |
4
|
1
|
|
|
1
|
|
9
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
{ |
8
|
|
|
|
|
|
|
package WebService::Braintree::SearchNode; |
9
|
|
|
|
|
|
|
$WebService::Braintree::SearchNode::VERSION = '0.93'; |
10
|
1
|
|
|
1
|
|
6702
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has 'searcher' => (is => 'rw'); |
13
|
|
|
|
|
|
|
has 'name' => (is => 'rw'); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'criteria' => (is => 'rw', default => sub {shift->default_criteria()}); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub default_criteria { |
18
|
0
|
|
|
0
|
0
|
|
return {}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub active { |
22
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
return %{$self->criteria}; |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub add_node { |
27
|
0
|
|
|
0
|
0
|
|
my ($self, $operator, $operand) = @_; |
28
|
0
|
|
|
|
|
|
$self->criteria->{$operator} = $operand; |
29
|
0
|
|
|
|
|
|
return $self->searcher; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
{ |
36
|
|
|
|
|
|
|
package WebService::Braintree::IsNode; |
37
|
|
|
|
|
|
|
$WebService::Braintree::IsNode::VERSION = '0.93'; |
38
|
1
|
|
|
1
|
|
6624
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
39
|
|
|
|
|
|
|
extends ("WebService::Braintree::SearchNode"); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub is { |
42
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
43
|
0
|
|
|
|
|
|
return $self->add_node("is", $operand); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
{ |
50
|
|
|
|
|
|
|
package WebService::Braintree::EqualityNode; |
51
|
|
|
|
|
|
|
$WebService::Braintree::EqualityNode::VERSION = '0.93'; |
52
|
1
|
|
|
1
|
|
6209
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
53
|
|
|
|
|
|
|
extends ("WebService::Braintree::IsNode"); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub is_not { |
56
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
57
|
0
|
|
|
|
|
|
return $self->add_node("is_not", $operand); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
{ |
64
|
|
|
|
|
|
|
package WebService::Braintree::KeyValueNode; |
65
|
|
|
|
|
|
|
$WebService::Braintree::KeyValueNode::VERSION = '0.93'; |
66
|
1
|
|
|
1
|
|
10167
|
use Moose; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
8
|
|
67
|
|
|
|
|
|
|
extends ("WebService::Braintree::SearchNode"); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub default_criteria { |
70
|
0
|
|
|
0
|
0
|
|
return ""; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub active { |
74
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
75
|
0
|
|
|
|
|
|
return $self->criteria; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub is { |
79
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
80
|
0
|
|
|
|
|
|
$self->criteria($operand); |
81
|
0
|
|
|
|
|
|
return $self->searcher; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
{ |
88
|
|
|
|
|
|
|
package WebService::Braintree::PartialMatchNode; |
89
|
|
|
|
|
|
|
$WebService::Braintree::PartialMatchNode::VERSION = '0.93'; |
90
|
1
|
|
|
1
|
|
10767
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
18
|
|
91
|
|
|
|
|
|
|
extends ("WebService::Braintree::EqualityNode"); |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub starts_with { |
94
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
95
|
0
|
|
|
|
|
|
return $self->add_node("starts_with", $operand); |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
sub ends_with { |
99
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
100
|
0
|
|
|
|
|
|
return $self->add_node("ends_with", $operand); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
103
|
|
|
|
|
|
|
1; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
{ |
107
|
|
|
|
|
|
|
package WebService::Braintree::TextNode; |
108
|
|
|
|
|
|
|
$WebService::Braintree::TextNode::VERSION = '0.93'; |
109
|
1
|
|
|
1
|
|
9676
|
use Moose; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
110
|
|
|
|
|
|
|
extends ("WebService::Braintree::PartialMatchNode"); |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub contains { |
113
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
114
|
0
|
|
|
|
|
|
return $self->add_node("contains", $operand); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
117
|
|
|
|
|
|
|
1; |
118
|
|
|
|
|
|
|
} |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
{ |
121
|
|
|
|
|
|
|
package WebService::Braintree::RangeNode; |
122
|
|
|
|
|
|
|
$WebService::Braintree::RangeNode::VERSION = '0.93'; |
123
|
1
|
|
|
1
|
|
7573
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
124
|
|
|
|
|
|
|
extends ("WebService::Braintree::EqualityNode"); |
125
|
|
|
|
|
|
|
|
126
|
1
|
|
|
1
|
|
7462
|
use overload ( '>=' => 'min', '<=' => 'max'); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
sub min { |
129
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
130
|
0
|
|
|
|
|
|
return $self->add_node("min", $operand); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub max { |
134
|
0
|
|
|
0
|
0
|
|
my ($self, $operand) = @_; |
135
|
0
|
|
|
|
|
|
return $self->add_node("max", $operand); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
sub between { |
139
|
0
|
|
|
0
|
0
|
|
my ($self, $min, $max) = @_; |
140
|
0
|
|
|
|
|
|
$self->max($max); |
141
|
0
|
|
|
|
|
|
$self->min($min); |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
144
|
|
|
|
|
|
|
1; |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
{ |
148
|
|
|
|
|
|
|
package WebService::Braintree::MultipleValuesNode; |
149
|
|
|
|
|
|
|
$WebService::Braintree::MultipleValuesNode::VERSION = '0.93'; |
150
|
1
|
|
|
1
|
|
219
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
69
|
|
151
|
1
|
|
|
1
|
|
7
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
152
|
1
|
|
|
1
|
|
6298
|
use WebService::Braintree::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
368
|
|
153
|
|
|
|
|
|
|
extends ("WebService::Braintree::SearchNode"); |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
has 'allowed_values' => (is => 'rw'); |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub default_criteria { |
158
|
0
|
|
|
0
|
0
|
|
return []; |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
sub active { |
162
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
163
|
0
|
|
|
|
|
|
return @{$self->criteria}; |
|
0
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
sub is { |
167
|
0
|
|
|
0
|
0
|
|
shift->in(@_); |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
sub _args_to_array { |
171
|
0
|
|
|
0
|
|
|
my $self = shift; |
172
|
0
|
|
|
|
|
|
my @args; |
173
|
0
|
0
|
|
|
|
|
if (ref($_[0]) eq 'ARRAY') { |
174
|
0
|
|
|
|
|
|
@args = @{$_[0]}; |
|
0
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
} else { |
176
|
0
|
|
|
|
|
|
@args = @_; |
177
|
|
|
|
|
|
|
} |
178
|
0
|
|
|
|
|
|
return @args; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
sub in { |
182
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
183
|
0
|
|
|
|
|
|
my @values = $self->_args_to_array(@_); |
184
|
|
|
|
|
|
|
|
185
|
0
|
|
|
|
|
|
my $bad_values = difference_arrays(\@values, $self->allowed_values); |
186
|
|
|
|
|
|
|
|
187
|
0
|
0
|
0
|
|
|
|
if (@$bad_values && $self->allowed_values) { |
188
|
0
|
|
|
|
|
|
croak "Invalid Argument(s) for " . $self->name . ": " . join(", ", @$bad_values); |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
@{$self->criteria} = @values; |
|
0
|
|
|
|
|
|
|
192
|
0
|
|
|
|
|
|
return $self->searcher; |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
195
|
|
|
|
|
|
|
1; |
196
|
|
|
|
|
|
|
} |