blib/lib/WWW/Shopify/Liquid/Filter/UrlForProduct.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 9 | 13 | 69.2 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 5 | 60.0 |
pod | 0 | 2 | 0.0 |
total | 12 | 20 | 60.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | #!/usr/bin/perl | ||||||
2 | 21 | 21 | 9731 | use strict; | |||
21 | 38 | ||||||
21 | 701 | ||||||
3 | 21 | 21 | 96 | use warnings; | |||
21 | 33 | ||||||
21 | 651 | ||||||
4 | |||||||
5 | 21 | 21 | 89 | package WWW::Shopify::Liquid::Filter::UrlForProduct; use base 'WWW::Shopify::Liquid::Filter'; | |||
21 | 40 | ||||||
21 | 2945 | ||||||
6 | 0 | 0 | 0 | sub max_arguments { return 1; } | |||
7 | 0 | 0 | 0 | sub operate { my $str = $_[2]; $str =~ s/\s/-/g; return "/products/" . lc($str); } | |||
0 | |||||||
0 | |||||||
8 | |||||||
9 | |||||||
10 | 1; |