Shopify/Model/Collect.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 9 totaltotal 0.0% 0 / 50 CC 1 SCAR 6.9
CC
1
Cov
0%
fields
2.0
BEGIN
2.0
queries
2.0
CRAP 2.0
1 #!/usr/bin/perl
2  
3 use strict;
4 use warnings;
5  
6 use WWW::Shopify;
7  
8 package WWW::Shopify::Model::Collect;
9 use parent "WWW::Shopify::Model::Item";
10  
11 my $fields; sub fields { return $fields; }
12 BEGIN { $fields = {
13 "product_id" => new WWW::Shopify::Field::Relation::ReferenceOne("WWW::Shopify::Model::Product", 1),
14 "collection_id" => new WWW::Shopify::Field::Relation::ReferenceOne(),
15 "created_at" => new WWW::Shopify::Field::Date(),
16 "updated_at" => new WWW::Shopify::Field::Date(),
17 "featured" => new WWW::Shopify::Field::Boolean(),
18 "position" => new WWW::Shopify::Field::Int(),
19 "id" => new WWW::Shopify::Field::Identifier(),
20 # Same as position, but padded with 0s. Unfortunately, this is a lie, and is ocassionally a product name, arbitarily.
21 "sort_value" => new WWW::Shopify::Field::String(),
22 }; }
23  
24  
25 my $queries; sub queries { return $queries; }
26 BEGIN { $queries = {
27 collection_id => new WWW::Shopify::Query::Match('collection_id'),
28 product_id => new WWW::Shopify::Query::Match('product_id')
29 }; }
30  
31 sub creation_minimal { return qw(product_id collection_id); }
32 sub creation_filled { return qw(position created_at); }
33 sub update_filled { return qw(updated_at); }
34  
35 sub read_scope { return "read_products"; }
36 sub write_scope { return "write_products"; }
37  
38 eval(__PACKAGE__->generate_accessors); die $@ if $@;
39  
40 1;