Class: ActiveRecord::ConnectionAdapters::Sqlserver::Showplan::PrinterXml
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::Sqlserver::Showplan::PrinterXml
- Defined in:
- lib/active_record/connection_adapters/sqlserver/showplan/printer_xml.rb
Instance Method Summary collapse
-
#initialize(result) ⇒ PrinterXml
constructor
A new instance of PrinterXml.
- #pp ⇒ Object
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
#pp ⇒ Object
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 |