Class: Thor::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/ngs/task.rb

Instance Method Summary collapse

Instance Method Details

#run(instance, args = []) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/bio/ngs/task.rb', line 16

def run(instance, args=[])
  public_method?(instance) ? instance.send(name, *args) : instance.class.handle_no_task_error(name)
 # save_history(instance,args) unless instance.class == Bio::Ngs::Runner or instance.class == Thor::Sandbox::History
rescue ArgumentError => e
  handle_argument_error?(instance, e, caller) ?
  instance.class.handle_argument_error(self, e) : (raise e)
rescue NoMethodError => e
  handle_no_method_error?(instance, e, caller) ?
  instance.class.handle_no_task_error(name) : (raise e)
end