« blib/lib/WWW/Shopify/Liquid/Filter/Within.pm
↑ Summary
blib/lib/WWW/Shopify/Liquid/Tag/Whitespace.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Tag::RemoveKey; | ||
| 6 | use base 'WWW::Shopify::Liquid::Tag::Free'; | ||
| 7 | sub min_arguments { return 1; } | ||
| 8 | sub max_arguments { return 1; } | ||
| 9 | sub process { | ||
| 10 | my ($self, $hash, $action, $pipeline) = @_; | ||
| 11 | my ($ref, $inner_hash, $key) = $pipeline->variable_reference($hash, $self->{arguments}->[0]); | ||
| 12 | delete $inner_hash->{$key} if $inner_hash && $key && exists $inner_hash->{$key}; | ||
| 13 | return $self; | ||
| 14 | } | ||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | 1; |