Class: Bitmapped::Commands::PrintTableCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/bitmapped/commands/print_table_command.rb

Instance Method Summary collapse

Instance Method Details

#command_idObject



7
8
9
# File 'lib/bitmapped/commands/print_table_command.rb', line 7

def command_id
  "S"
end

#process_command(bitmap, input) ⇒ Object



11
12
13
14
15
16
# File 'lib/bitmapped/commands/print_table_command.rb', line 11

def process_command(bitmap, input)
  Validators::ValidateBitmapInitialised.parse_and_validate(bitmap)
  table = bitmap.pixels.collect { |row| row.join("") }.join("\n")
  puts table
  table
end