blib/lib/WWW/Shopify/Liquid/Filter/Last.pm untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 6 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 31 CC 3 SCAR 18.4
CC
3
Cov
0%
operate
12.0
transparent
2.0
BEGIN
2.0
CRAP 6.3
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4  
5 package WWW::Shopify::Liquid::Filter::Last; use base 'WWW::Shopify::Liquid::Filter';
6 sub transparent { return 1; }
7 sub operate {
8 my ($self, $hash, $operand, @arguments) = @_;
9 return $operand->[-1] if $operand && ref($operand) eq "ARRAY";
10 return $operand->{last} if $operand && ref($operand) eq "HASH";
11 return undef;
12 }
13  
14 1;