Method: Nokogiri::XML::Node#clone
- Defined in:
- lib/nokogiri/xml/node.rb
permalink #clone(level = 1, new_parent_doc = document) ⇒ Object
:call-seq:
clone → Nokogiri::XML::Node
clone(level) → Nokogiri::XML::Node
clone(level, new_parent_doc) → Nokogiri::XML::Node
Clone this node.
- Parameters
-
level
(optional Integer). 0 is a shallow copy, 1 (the default) is a deep copy. -
new_parent_doc
The new node’s parent Document. Defaults to the the Document of the current node.
- Returns
-
The new Nokogiri::XML::Node
162 163 164 |
# File 'lib/nokogiri/xml/node.rb', line 162 def clone(level = 1, new_parent_doc = document) super().initialize_copy_with_args(self, level, new_parent_doc) end |