File Coverage

blib/lib/WWW/Shopify/Liquid/Operator/Assignment.pm
Criterion Covered Total %
statement 14 20 70.0
branch n/a
condition n/a
subroutine 6 9 66.6
pod 0 4 0.0
total 20 33 60.6


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 37     37   295 use strict;
  37         90  
  37         1063  
3 37     37   213 use warnings;
  37         106  
  37         1466  
4              
5             package WWW::Shopify::Liquid::Operator::Assignment;
6 37     37   241 use base 'WWW::Shopify::Liquid::Operator';
  37         88  
  37         3990  
7 37     37   279 use List::Util qw(first);
  37         98  
  37         8285  
8 1318     1318 0 3754 sub symbol { return '='; }
9 9265     9265 0 23999 sub priority { return 1; }
10             # Can't optimize this away; it's generally necessary for assignment tags, so we just assume taht this is always going to be there.
11              
12             sub optimize {
13 0     0 0   my ($self, $optimizer) = (shift, shift);
14 0           $self->SUPER::optimize($self, $optimizer, @_);
15 0           return $self;
16             }
17              
18             sub operate {
19 0     0 0   return first { ($_ cmp $_[4]) == 0 } ref($_[3]) eq "ARRAY";
  0     0      
20 0           return index($_[3], $_[4]) != -1;
21             }
22              
23             1;