Sha256: 1d03f55ea5067de749805195d396fc00df897ef878b619a4493ec446e156dc94

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

require 'nokogiri'

module Nokogiri
  module XML
    class Element < Node

      def similar?(other)
        return false unless super(other)
        return false unless attribute_nodes.length == other.attribute_nodes.length

        (0...attribute_nodes.length).each do |index|
          attr1 = attribute_nodes[index]
          attr2 = other.attribute_nodes[index]

          return false unless attr1.similar?(attr2)
        end

        true
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ronin-web-0.2.1 lib/ronin/web/extensions/nokogiri/xml/element.rb
ronin-web-0.2.0 lib/ronin/web/extensions/nokogiri/xml/element.rb
ronin-web-0.1.3 lib/ronin/web/extensions/nokogiri/xml/element.rb
ronin-web-0.1.2 lib/ronin/web/extensions/nokogiri/xml/element.rb
ronin-web-0.1.1 lib/ronin/web/extensions/nokogiri/xml/element.rb