File Coverage

blib/lib/WWW/Shopify/Liquid/Filter/ProductImgUrl.pm
Criterion Covered Total %
statement 11 15 73.3
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 3 0.0
total 16 24 66.6


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   9973 use strict;
  21         38  
  21         711  
3 21     21   100 use warnings;
  21         35  
  21         729  
4              
5             # TODO: Write this.
6             package WWW::Shopify::Liquid::Filter::ProductImgUrl;
7 21     21   91 use base 'WWW::Shopify::Liquid::Filter';
  21         32  
  21         4168  
8 1     1 0 9 sub min_arguments { return 1; }
9 2     2 0 12 sub max_arguments { return 1; }
10             sub operate {
11 0     0 0   my ($self, $hash, $operand, @arguments) = @_;
12 0           my $size = $arguments[0];
13 0           $operand =~ s/(\.(jpg|png|jpeg|gif))/_$size$1/i;
14 0           return $operand;
15             }
16              
17             1;