Class: Bitmapped::Commands::RotateCommand

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

Instance Method Summary collapse

Instance Method Details

#command_idObject



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

def command_id
  "R"
end

#process_command(bitmap, _) ⇒ Object



11
12
13
14
# File 'lib/bitmapped/commands/rotate_command.rb', line 11

def process_command(bitmap, _)
  Validators::ValidateBitmapInitialised.parse_and_validate(bitmap)
  bitmap.pixels = bitmap.pixels.transpose.map &:reverse
end