File Coverage

blib/lib/WWW/Shopify/Liquid/Filter/Last.pm
Criterion Covered Total %
statement 10 14 71.4
branch 0 4 0.0
condition 0 6 0.0
subroutine 4 5 80.0
pod 0 2 0.0
total 14 31 45.1


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   10141 use strict;
  21         39  
  21         721  
3 21     21   95 use warnings;
  21         31  
  21         641  
4              
5 21     21   87 package WWW::Shopify::Liquid::Filter::Last; use base 'WWW::Shopify::Liquid::Filter';
  21         32  
  21         2889  
6 23     23 0 222 sub transparent { return 1; }
7             sub operate {
8 0     0 0   my ($self, $hash, $operand, @arguments) = @_;
9 0 0 0       return $operand->[-1] if $operand && ref($operand) eq "ARRAY";
10 0 0 0       return $operand->{last} if $operand && ref($operand) eq "HASH";
11 0           return undef;
12             }
13              
14             1;