File Coverage

blib/lib/WWW/Shopify/Liquid/Filter/First.pm
Criterion Covered Total %
statement 14 14 100.0
branch 4 4 100.0
condition 5 6 83.3
subroutine 5 5 100.0
pod 0 2 0.0
total 28 31 90.3


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 37     37   14530 use strict;
  37         111  
  37         1185  
3 37     37   239 use warnings;
  37         102  
  37         1366  
4              
5 37     37   234 package WWW::Shopify::Liquid::Filter::First; use base 'WWW::Shopify::Liquid::Filter';
  37         88  
  37         6750  
6 86     86 0 600 sub transparent { return 1; }
7             sub operate {
8 28     28 0 86 my ($self, $hash, $operand, @arguments) = @_;
9 28 100 100     133 return $operand->[0] if $operand && ref($operand) eq "ARRAY";
10 24 100 66     148 return $operand->{first} if $operand && ref($operand) eq "HASH";
11 4         13 return undef;
12             }
13              
14             1;