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.



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

def initialize(result)
  @result = result
end

Instance Method Details

#ppObject



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

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