Class: ActiveRecord::ConnectionAdapters::SQLServer::Showplan::PrinterXml

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ PrinterXml

Returns a new instance of PrinterXml.



8
9
10
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb', line 8

def initialize(result)
  @result = result
end

Instance Method Details

#ppObject



12
13
14
15
16
17
18
19
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb', line 12

def pp
  xml = @result.rows.first.first
  if defined?(Nokogiri)
    Nokogiri::XML(xml).to_xml indent: 2, encoding: "UTF-8"
  else
    xml
  end
end