Class: Xembly::Remove

Inherits:
Object
  • Object
show all
Defined in:
lib/xembly/remove.rb

Overview

REMOVE directive

Instance Method Summary collapse

Instance Method Details

#exec(_, cursor) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/xembly/remove.rb', line 28

def exec(_, cursor)
  after = []
  cursor.each do |node|
    Xembly.log.info "node \"#{node.name}\" removed"
    parent = node.parent
    node.remove
    after.push(parent)
  end
  after
end