Google

def delete element if element.kind_of? Element @element.delete element else el = self[element] el.remove if el end end