Class: Bitmapped::Commands::HorizontalLineCommand

Inherits:
BaseCommand
  • Object
show all
Includes:
CommandsHelper
Defined in:
lib/bitmapped/commands/horizontal_line_command.rb

Instance Method Summary collapse

Methods included from CommandsHelper

#coordinates_to_array_indexes, #valid_cooridinates

Instance Method Details

#command_idObject



10
11
12
# File 'lib/bitmapped/commands/horizontal_line_command.rb', line 10

def command_id
  "H"
end

#process_command(bitmap, input) ⇒ Object



14
15
16
17
18
# File 'lib/bitmapped/commands/horizontal_line_command.rb', line 14

def process_command(bitmap, input)
  Validators::ValidateBitmapInitialised.parse_and_validate(bitmap)
  column, start, finish, color = Validators::ValidateSegmentInput.parse_and_validate(input)
  horizontal_command(bitmap, column, start, finish, color)
end