class CommandParser

Base class to create a command-line parameter parser.

It holds that parameters in a hash and the child has to be the one who return the formatted string according to the standard used.

Public Class Methods

new() click to toggle source

Create a new instance of the parser.

# File lib/runnable/command_parser.rb, line 26
def initialize
  @params = {}
end

Public Instance Methods

add_param( param, value = nil ) click to toggle source

Add params and value to the params hash to be parsed. @param [String] param Parameter name. @param [Object] value Parameter value. @return [nil]

# File lib/runnable/command_parser.rb, line 34
def add_param( param, value = nil )
  @params[param] = value
end
parse() click to toggle source

This method has to be overwritten in the child @abstract @return [Array]

# File lib/runnable/command_parser.rb, line 41
def parse
end