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.
14 15 16 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 14 def initialize(result) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
12 13 14 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 12 def result @result end |
Instance Method Details
#pp ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_record/connection_adapters/sqlserver/showplan/printer_table.rb', line 18 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 |