Method: Oga::XML::Node#replace
- Defined in:
- lib/oga/xml/node.rb
#replace(other) ⇒ Object
Replaces the current node with another.
131 132 133 134 135 136 137 138 |
# File 'lib/oga/xml/node.rb', line 131 def replace(other) if other.is_a?(String) other = Text.new(:text => other) end before(other) remove end |