File Coverage

blib/lib/WWW/Shopify/Liquid/Tag/Enclosing.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 4 50.0
condition n/a
subroutine 9 9 100.0
pod 0 6 0.0
total 31 39 79.4


line stmt bran cond sub pod time code
1             #!/usr/bin/perl
2 21     21   149 use strict;
  21         39  
  21         1001  
3 21     21   108 use warnings;
  21         42  
  21         840  
4              
5             package WWW::Shopify::Liquid::Tag::Enclosing;
6 21     21   120 use base 'WWW::Shopify::Liquid::Tag';
  21         47  
  21         9716  
7 253 50   253 0 556 sub abstract { my $package = ref($_[0]) ? ref($_[0]) : $_[0]; return ($package eq __PACKAGE__); }
  253         837  
8 460     460 0 2062 sub is_enclosing { return 1; }
9 188     188 0 905 sub inner_tags { return (); }
10 95     95 0 349 sub inner_ignore_whitespace { return 0; }
11             # Interprets the inner of this tag as being completely text. Used for comments and raws.
12 184     184 0 827 sub inner_halt_lexing { return 0; }
13              
14             sub new {
15 27     27 0 73 my ($package, $line, $tag, $arguments, $contents) = @_;
16 27         70 my $self = { line => $line, core => $tag, arguments => $arguments, contents => @{$contents->[0]} };
  27         156  
17 27 50       123 die new WWW::Shopify::Liquid::Exception::Parser($self, "Uncustomized tags can only have one element following their contents.") unless int(@$contents) == 1;
18 27         137 return bless $self, $package;
19             }
20              
21             1;