| 1 | { | ||||||||||
| 2 | 1 | package Net::Braintree::AdvancedSearchFields; | |||||||||
| 3 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | has "metaclass" => (is => 'rw'); | |||||||||
| 7 | |||||||||||
| 8 | 101 | ▶ | sub field { | ||||||||
|
Subroutine
field: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | 101 | my ($self, $name, $node) = @_; | |||||||||
| 10 | 101 | $self->metaclass->add_attribute($name, is => 'rw', default => $node); | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | sub is { | ||||||||
|
Subroutine
is: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 14 | 1 | my ($self, $name) = @_; | |||||||||
| 15 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 16 | 0 | return Net::Braintree::IsNode->new(searcher => shift, name => $name); | |||||||||
| 17 | 1 | }); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 3 | ▶ | sub equality { | ||||||||
|
Subroutine
equality: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 21 | 3 | my ($self, $name) = @_; | |||||||||
| 22 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 23 | 0 | return Net::Braintree::EqualityNode->new(searcher => shift, name => $name); | |||||||||
| 24 | 3 | }); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 60 | ▶ | sub text { | ||||||||
|
Subroutine
text: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 28 | 60 | my ($self, $name) = @_; | |||||||||
| 29 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 30 | 0 | return Net::Braintree::TextNode->new(searcher => shift, name => $name); | |||||||||
| 31 | 60 | }); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 1 | ▶ | sub key_value { | ||||||||
|
Subroutine
key_value: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 35 | 1 | my ($self, $name) = @_; | |||||||||
| 36 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 37 | 0 | return Net::Braintree::KeyValueNode->new(searcher => shift, name => $name); | |||||||||
| 38 | 1 | }); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 18 | ▶ | sub range { | ||||||||
|
Subroutine
range: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 42 | 18 | my ($self, $name) = @_; | |||||||||
| 43 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 44 | 0 | return Net::Braintree::RangeNode->new(searcher => shift, name => $name); | |||||||||
| 45 | 18 | }); | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 15 | ▶ | sub multiple_values { | ||||||||
|
Subroutine
multiple_values: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||
| 49 | 15 | my ($self, $name, @allowed_values) = @_; | |||||||||
| 50 | 0 | ▶ | my $node = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 51 | 0 | ▶ | return Net::Braintree::MultipleValuesNode->new( | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | searcher => shift, | ||||||||||
| 53 | name => $name, | ||||||||||
| 54 | allowed_values => @allowed_values ? [@allowed_values] : undef) | ||||||||||
| 55 | 15 | }; | |||||||||
| 56 | 15 | $self->field($name, $node); | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 3 | ▶ | sub partial_match { | ||||||||
|
Subroutine
partial_match: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 60 | 3 | my ($self, $name) = @_; | |||||||||
| 61 | 0 | ▶ | $self->field($name, sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 62 | 0 | return Net::Braintree::PartialMatchNode->new(searcher => shift, name => $name); | |||||||||
| 63 | 3 | }); | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 1 | 1; | |||||||||
| 67 | } | ||||||||||