| 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 | sub field { | ||||||||||
| 9 | 101 | ▶ | my ($self, $name, $node) = @_; | ||||||||
|
Subroutine
field: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 10 | 101 | $self->metaclass->add_attribute($name, is => 'rw', default => $node); | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | sub is { | ||||||||||
| 14 | 1 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
is: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 15 | $self->field($name, sub { | ||||||||||
| 16 | 0 | ▶ | return Net::Braintree::IsNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 17 | 1 | }); | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | sub equality { | ||||||||||
| 21 | 3 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
equality: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 22 | $self->field($name, sub { | ||||||||||
| 23 | 0 | ▶ | return Net::Braintree::EqualityNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 24 | 3 | }); | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | sub text { | ||||||||||
| 28 | 60 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
text: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 29 | $self->field($name, sub { | ||||||||||
| 30 | 0 | ▶ | return Net::Braintree::TextNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 31 | 60 | }); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | sub key_value { | ||||||||||
| 35 | 1 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
key_value: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 36 | $self->field($name, sub { | ||||||||||
| 37 | 0 | ▶ | return Net::Braintree::KeyValueNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 38 | 1 | }); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | sub range { | ||||||||||
| 42 | 18 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
range: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 43 | $self->field($name, sub { | ||||||||||
| 44 | 0 | ▶ | return Net::Braintree::RangeNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 45 | 18 | }); | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | sub multiple_values { | ||||||||||
| 49 | 15 | ▶ | my ($self, $name, @allowed_values) = @_; | ||||||||
|
Subroutine
multiple_values: called CC=1 SCAR=1.2
Pod
undocumented
| |||||||||||
| 50 | my $node = sub { | ||||||||||
| 51 | 0 | ▶ | return Net::Braintree::MultipleValuesNode->new( | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
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 | sub partial_match { | ||||||||||
| 60 | 3 | ▶ | my ($self, $name) = @_; | ||||||||
|
Subroutine
partial_match: called CC=1 SCAR=0.4
Pod
undocumented
| |||||||||||
| 61 | $self->field($name, sub { | ||||||||||
| 62 | 0 | ▶ | return Net::Braintree::PartialMatchNode->new(searcher => shift, name => $name); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 63 | 3 | }); | |||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | 1 | 1; | |||||||||
| 67 | } | ||||||||||