Class: REXML::Element

Inherits:
Object show all
Defined in:
lib/rexml_overrides.rb

Instance Method Summary collapse

Instance Method Details

#==(another_element) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/rexml_overrides.rb', line 2

def ==(another_element)
  return false unless another_element.is_a?(REXML::Element)
  return false unless self.name == another_element.name
  return false unless self.text.try(:strip).to_s == another_element.text.try(:strip).to_s
  return false unless self.attributes == another_element.attributes
  return child_elements_equal?(another_element)
end