Class: Nokogiri::XML::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/utils/xml.rb

Instance Method Summary collapse

Instance Method Details

#add_first_child(content) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/utils/xml.rb', line 10

def add_first_child(content)
  if children.empty?
    add_child(content)
  else
    children.first.previous = content
  end
  self
end