Class: JSONom::Executioner

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Executioner

Returns a new instance of Executioner.



6
7
8
9
# File 'lib/jsonom/executioner.rb', line 6

def initialize(*args)
	@args = args
	@commands = ArgumentParser.parse_arguments(@args)
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/jsonom/executioner.rb', line 3

def args
  @args
end

#commandsObject

Returns the value of attribute commands.



4
5
6
# File 'lib/jsonom/executioner.rb', line 4

def commands
  @commands
end

Class Method Details

.execute(*args) ⇒ Object



11
12
13
# File 'lib/jsonom/executioner.rb', line 11

def self.execute(*args)
	new(*args).execute
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/jsonom/executioner.rb', line 15

def execute
	opfile = nil
	opprop = nil

	@commands.each_with_index do |command, index|
		if(command == "set_file...")
			opfile = @commands[index + 1]
		elsif(command == "get_property...")
			opprop = @commands[index + 1]
		elsif(command =~ /\Adebug\_/)
			JSONParser.debug(opfile, opprop)
		end
	end
end