Class: BitmapCmdEditor::Validators::CommandValidator
- Inherits:
-
Object
- Object
- BitmapCmdEditor::Validators::CommandValidator
- Defined in:
- lib/bitmap_cmd_editor/validators/command_validator.rb
Overview
To validate the command and show the user a help message
Class Method Summary collapse
Class Method Details
.validate(input) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/bitmap_cmd_editor/validators/command_validator.rb', line 8 def validate(input) begin args=input.split(' ') raise NotImplementedCommand.new(ErrorMessage.new(:command_not_exist).show_content) unless BitmapCmdEditor::COMMANDS.include?(args[0]) :valid rescue NotImplementedCommand => err err. end end |