lib/memcached-server/server.rb
# Validates a command.
# If the command isn't valid it returns nil.
# 
# @param command [String] A command to validate
# @return [MatchData, nil] It encapsulates all the results of a valid command pattern match
Validates a command.
If the command isn't valid it returns nil.
Validates a command . If the command isn ' t valid it returns nil .
def validate_command(command)
            valid_formats = CommandFormat.constants.map{| key | CommandFormat.const_get(key)}
            valid_formats.each do | form |
                valid_command = command.match(form)
                return valid_command unless valid_command.nil?
            end
            return nil
        end
def validate_command ( command ) valid_formats = CommandFormat . constants . map { | key | CommandFormat . const_get ( key ) } valid_formats . each do | form | valid_command = command . match ( form ) return valid_command unless valid_command . nil? end return nil end
Validates a command.
Validates a command .
It encapsulates all the results of a valid command pattern match
It encapsulates all the results of a valid command pattern match
MatchData, nil
command
A command to validate
A command to validate