class Arrays::HashDeleteTag

Public Instance Methods

parse(tokens) click to toggle source
Calls superclass method
# File lib/liquid-arrays/hash_delete_tag.rb, line 5
def parse(tokens)
  super
  catch do
    parser = AttributeParser.new(@parse_context, 'key', @markup)
    @hash_name = parser.consume_attribute('hash', :id)
    @key = parser.consume_required_attribute('key')
    parser.finish
  end
end
render(context) click to toggle source
# File lib/liquid-arrays/hash_delete_tag.rb, line 15
def render(context)
  hash = HashHelper.get_hash(context, @hash_name, false)
  unless hash.nil?
    hash.delete(@key.render(context))
  end
  ''
end