class BitmapCmdEditor::Validators::CommandValidator
@author Diego HernĂ¡n Piccinini Lagos To validate the command and show the user a help message
Public Class Methods
validate(input)
click to toggle source
@param input [String] the input command string
# 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.message end end