Sha256: a4cf960dc20d0c1e875a6a024a03db8aa918f3da9b90d43bd4cd6b12c042a37a
Contents?: true
Size: 690 Bytes
Versions: 41
Compression:
Stored size: 690 Bytes
Contents
module OrigenTesters::ATP module Processors # Appends the given node to the node with the given ID, if it exists # somewhere within the given parent node class AppendTo < Processor def run(parent, node, id, options = {}) @to_be_appended = node @id_of_to_be_appended_to = id @found = false process(parent) end def succeeded? @found end def handler_missing(node) if node.id == @id_of_to_be_appended_to @found = true node.updated(nil, node.children + [@to_be_appended]) else node.updated(nil, process_all(node.children)) end end end end end
Version data entries
41 entries across 41 versions & 1 rubygems