Module: Zendesk::Processor

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

Instance Method Summary collapse

Instance Method Details

#process(command, file_paths, strategy = Strategy::Simple) ⇒ Object


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

def process(command, file_paths, strategy = Strategy::Simple)
  command_ast = CommandParser.parse(command)
  db          = strategy.load(file_paths)
  results     = strategy.exec(db, command_ast)

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