Module: Zendesk::Processor

Extended by:
Processor
Included in:
Processor
Defined in:
lib/zendesk/processer.rb

Instance Method Summary collapse

Instance Method Details

#process(command_string, file_paths, strategy_string) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/zendesk/processer.rb', line 10

def process(command_string, file_paths, strategy_string)
  command_ast = CommandParser.parse(command_string)
  strategy    = Strategy.get(strategy_string)
  db          = strategy.load_files(file_paths)
  results     = strategy.execute(db, command_ast)

  do_execute_related strategy, db, results
rescue Errno::ENOENT => e
  raise Zendesk::Error, e.message
end