blib/lib/WWW/Shopify/Liquid/Tag/Enclosing.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/WWW/Shopify/Liquid/Dialect/Web.pm ↑ Summary
1 #!/usr/bin/perl
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package WWW::Shopify::Liquid::Tag::Enclosing;
6 1 ▶use base 'WWW::Shopify::Liquid::Tag';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 sub abstract { my $package = ref($_[0]) ? ref($_[0]) : $_[0]; return ($package eq __PACKAGE__); }
8 sub is_enclosing { return 1; }
9 sub inner_tags { return (); }
10 sub inner_ignore_whitespace { return 0; }
11 # Interprets the inner of this tag as being completely text. Used for comments and raws.
12 sub inner_halt_lexing { return 0; }
13 sub subelements { qw(contents arguments) }
14  
15 sub new {
16 my ($package, $line, $tag, $arguments, $contents) = @_;
17 my $self = { line => $line, core => $tag, arguments => $arguments, contents => @{$contents->[0]} };
18 die new WWW::Shopify::Liquid::Exception::Parser($self, "Uncustomized tags can only have one element following their contents.") unless int(@$contents) == 1;
19 return bless $self, $package;
20 }
21  
22 sub strip_left_end { $_[0]->{strip_left_end} = $_[1] if @_ > 1; return $_[0]->{strip_left_end}; }
23 sub strip_right_end { $_[0]->{strip_right_end} = $_[1] if @_ > 1; return $_[0]->{strip_right_end}; }
24  
25  
26 sub process {
27 my ($self, $hash, $action, $pipeline) = @_;
28 my ($contents, $arguments) = $self->process_subelements($hash, $action, $pipeline);
29 return $self unless $self->is_processed($contents) && int(grep { !$self->is_processed($_) } @$arguments) == 0;
30 return $self->operate($hash, $contents, @$arguments);
31 }
32  
33 1;
« blib/lib/WWW/Shopify/Liquid/Dialect/Web.pm ↑ Summary