Class: ExodusTaskInfo

Inherits:
Object show all
Defined in:
lib/exodus_task_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(dispatched_babel_tasks) ⇒ ExodusTaskInfo

Returns a new instance of ExodusTaskInfo.



10
11
12
# File 'lib/exodus_task_info.rb', line 10

def initialize(dispatched_babel_tasks)
  @babel_tasks = dispatched_babel_tasks
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args, &block) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/exodus_task_info.rb', line 20

def method_missing(id, *args, &block)
  loop {
    @babel_tasks.each_with_index { |task, i|
    begin
      Timeout::timeout(2) {
        result = task.send(id, *args, &block)
        return result
      }
    rescue Timeout::Error
      next
    end
    }
  }
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/exodus_task_info.rb', line 15

def to_s
  method_missing(:to_s)
end