Class: JSONom::ArgumentParser

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonom/argument_parser.rb

Class Method Summary collapse

Class Method Details

.parse_arguments(argument_array = []) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/jsonom/argument_parser.rb', line 3

def self.parse_arguments(argument_array = [])
  commands = []

  if(argument_array.length == 0)
    commands = ["help"]
  elsif(argument_array.length == 1)
    commands = ["set_file...", argument_array[0], "debug_file"]
  elsif(argument_array.length == 2)
    commands = ["set_file...", argument_array[0], "get_property...", argument_array[1], "debug_property"]
  end

  return commands
end