Class: Fit::TablePrintingFixtureListener
- Inherits:
-
Object
- Object
- Fit::TablePrintingFixtureListener
- Defined in:
- lib/fit/fit_server.rb
Instance Method Summary collapse
-
#initialize(socket) ⇒ TablePrintingFixtureListener
constructor
A new instance of TablePrintingFixtureListener.
- #print_table(table, output) ⇒ Object
- #table_finished(tableParse) ⇒ Object
- #tables_finished(counts) ⇒ Object
Constructor Details
#initialize(socket) ⇒ TablePrintingFixtureListener
Returns a new instance of TablePrintingFixtureListener.
149 150 151 |
# File 'lib/fit/fit_server.rb', line 149 def initialize(socket) @socket = socket end |
Instance Method Details
#print_table(table, output) ⇒ Object
159 160 161 162 163 164 165 166 167 |
# File 'lib/fit/fit_server.rb', line 159 def print_table(table, output) more = table.more table.more = nil if table.trailer.nil? table.trailer = "" end table.print(output) table.more = more end |
#table_finished(tableParse) ⇒ Object
153 154 155 156 157 |
# File 'lib/fit/fit_server.rb', line 153 def table_finished(tableParse) buffer = PrintString.new print_table(tableParse, buffer) FitProtocol.write_document(buffer.to_s, @socket) end |
#tables_finished(counts) ⇒ Object
169 170 171 |
# File 'lib/fit/fit_server.rb', line 169 def tables_finished(counts) FitProtocol.write_counts(counts, @socket) end |