Module: NewRelic::Security::Instrumentation::Nokogiri::XML::NodeSet::Chain

Defined in:
lib/newrelic_security/instrumentation-security/nokogiri/chain.rb

Class Method Summary collapse

Class Method Details

.instrument!Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/newrelic_security/instrumentation-security/nokogiri/chain.rb', line 28

def self.instrument!
  ::Nokogiri::XML::NodeSet.class_eval do
    include NewRelic::Security::Instrumentation::Nokogiri::XML
    
    alias_method :xpath_without_security, :xpath
    
    def xpath(*var)
      retval = nil
      event = xpath_on_enter(*var) { retval = xpath_without_security(*var) }
      xpath_on_exit(event) { return retval }
    end
  end
end