Class: ActiveRecord::ConnectionAdapters::SQLServer::Showplan::PrinterTable
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::SQLServer::Showplan::PrinterTable
- Defined in:
- lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result) ⇒ PrinterTable
constructor
A new instance of PrinterTable.
- #pp ⇒ Object
Constructor Details
#initialize(result) ⇒ PrinterTable
Returns a new instance of PrinterTable.
12 13 14 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 12 def initialize(result) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 10 def result @result end |
Instance Method Details
#pp ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 16 def pp @widths = compute_column_widths @separator = build_separator pp = [] pp << @separator pp << build_cells(result.columns) pp << @separator result.rows.each do |row| pp << build_cells(row) end pp << @separator pp.join("\n") + "\n" end |