« blib/lib/WWW/Shopify/Liquid/Filter/StripHtml.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Dialect/Shopify/Filter/Handleize.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Tag::Free; | ||
| 6 | use base 'WWW::Shopify::Liquid::Tag'; | ||
| 7 | sub is_free { return 1; } | ||
| 8 | sub abstract { my $package = ref($_[0]) ? ref($_[0]) : $_[0]; return ($package eq __PACKAGE__); } | ||
| 9 | sub subelements { qw(arguments); } | ||
| 10 | |||
| 11 | sub new { | ||
| 12 | my ($package, $line, $tag, $arguments) = @_; | ||
| 13 | my $self = { line => $line, core => $tag, arguments => $arguments }; | ||
| 14 | return bless $self, $package; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub process { | ||
| 18 | my ($self, $hash, $action, $pipeline) = @_; | ||
| 19 | my $arguments = $self->process_subelement($hash, $action, $pipeline, $self->{arguments}); | ||
| 20 | return $self unless int(grep { !$self->is_processed($_) } @$arguments) == 0; | ||
| 21 | return $self->operate($hash, @$arguments); | ||
| 22 | } | ||
| 23 | |||
| 24 | 1; |