« lib/WWW/Shopify/Liquid/Filter/Sprintf.pm
↑ Summary
lib/WWW/Shopify/Liquid/Dialect/Web/Filter/EscapeHTML.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Filter::Within; | ||
| 6 | use base 'WWW::Shopify::Liquid::Filter'; | ||
| 7 | |||
| 8 | sub min_arguments { return 1; } | ||
| 9 | sub max_arguments { return 1; } | ||
| 10 | sub operate { | ||
| 11 | my ($self, $hash, $operand, $collection) = @_; | ||
| 12 | return $operand unless $collection; | ||
| 13 | return "/collections/" . $collection->{handle} . $operand; | ||
| 14 | } | ||
| 15 | |||
| 16 | 1; |