replace_child( to_replace, replacement )
public
Replaces one child with another, making sure the nodelist is correct @param
to_replace the child to replace (must be a Child) @param replacement the child to insert
into the nodelist (must be a Child)
Show source
def replace_child( to_replace, replacement )
@children.map! {|c| c.equal?( to_replace ) ? replacement : c }
to_replace.parent = nil
replacement.parent = self
end