blib/lib/WWW/Shopify/Query.pm

filter: Statementstmt 82.8% 29 / 35 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 76.4% 13 / 17 Podpod 0.0% 0 / 3 totaltotal 72.8% 43 / 59 CC 3 SCAR 5.9
CC
3
Cov
77%
field_name
6.0
name
2.1
new
2.0
CRAP 1.8
« blib/lib/WWW/Shopify/Model/Order/Fulfillment/Receipt.pm ↑ Summary blib/lib/WWW/Shopify/Field/String.pm »
1 #!/usr/bin/perl
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =head1 NAME
7  
8 Query - Basic Description of Filters on Shopify
9  
10 =cut
11  
12 =head1 DESCRIPTION
13  
14 Queries describe Shopify filters that can be put on get requests. This allows them to be translated into local database queries for testing purposes.
15  
16 The following queries exist:
17  
18 =cut
19  
20 package WWW::Shopify::Query;
21 0 ▶sub new { return bless { name => undef }, $_[0]; }
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
22 66 ▶sub name { $_[0]->{name} = $_[1] if defined $_[1]; return $_[0]->{name}; }
Subroutine name: called CC=2 SCAR=7.2
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 66 0 66
23 0 ▶sub field_name { $_[0]->{field_name} = $_[1] if defined $_[1]; return $_[0]->{field_name}; }
Subroutine field_name: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[1] 0 0 0
24  
25 =head2 WWW::Shopify::Query::LowerBound
26  
27 Specifies a lower bound on the specified field. An example of this is WWW::Shopify::Model::Product's created_at_min query, which links to the created_at field.
28  
29 =cut
30  
31 package WWW::Shopify::Query::LowerBound;
32 1 ▶use parent 'WWW::Shopify::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
33 27 ▶sub new { return bless { 'field_name' => $_[1] }, $_[0]; }
Subroutine new: called CC=1 SCAR=0.0
34  
35 =head2 WWW::Shopify::Query::UpperBound
36  
37 As above, except an upper bound.
38  
39 =cut
40  
41 package WWW::Shopify::Query::UpperBound;
42 1 ▶use parent 'WWW::Shopify::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
43 19 ▶sub new { return bless { 'field_name' => $_[1] }, $_[0]; }
Subroutine new: called CC=1 SCAR=0.0
44  
45 =head2 WWW::Shopify::Query::Enum
46  
47 A query that states that a field can be equal to one of the specified enumerations.
48  
49 =cut
50  
51 package WWW::Shopify::Query::Enum;
52 1 ▶use parent 'WWW::Shopify::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
53 7 ▶sub new { return bless { 'field_name' => $_[1], 'enums' => $_[2] }, $_[0]; }
Subroutine new: called CC=1 SCAR=0.0
54 0 ▶sub enums { return @{$_[0]->{enums}}; }
Subroutine enums: not called CC=1 SCAR=6.9
55  
56 =head2 WWW::Shopify::Query::Match
57  
58 A query that states that the specified field must exactly equal the input, though there is no restriction on what this input might be.
59  
60 =cut
61  
62 package WWW::Shopify::Query::Match;
63 1 ▶use parent 'WWW::Shopify::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
64 10 ▶sub new { return bless { 'field_name' => $_[1] }, $_[0]; }
Subroutine new: called CC=1 SCAR=0.0
65  
66 =head2 WWW::Shopify::Query::Custom
67  
68 A query that takes a sub that details how to handle the query.
69  
70 =cut
71  
72  
73 package WWW::Shopify::Query::Custom;
74 1 ▶use parent 'WWW::Shopify::Query';
Subroutine BEGIN: called CC=1 SCAR=0.0
75 3 ▶sub new { return bless { 'field_name' => $_[1], 'sub' => $_[2] }, $_[0]; }
Subroutine new: called CC=1 SCAR=0.0
76 0 ▶sub routine { return $_[0]->{'sub'}; }
Subroutine routine: not called CC=1 SCAR=6.9
77  
78 1 1;
« blib/lib/WWW/Shopify/Model/Order/Fulfillment/Receipt.pm ↑ Summary blib/lib/WWW/Shopify/Field/String.pm »