previous_element

previous_element()
Instance Public methods

Returns the previous sibling that is an element, or nil if there is no Element sibling prior to this one

doc = Document.new '<a><b/>text<c/></a>'
doc.root.elements['c'].previous_element          #-> <b/>
doc.root.elements['b'].previous_element          #-> nil
doc_ruby_on_rails
2015-05-06 11:30:23
Comments
Leave a Comment

Please login to continue.