Module: ExecutionDeadline::Helpers

Defined in:
lib/execution_deadline/helpers.rb

Instance Method Summary collapse

Instance Method Details

#deadline(options = {}) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/execution_deadline/helpers.rb', line 9

def deadline(options = {})
  options[:in] ||
    options[:runs_for] ||
    raise('expected deadline to include either :in or :runs_for')

  @last_deadline_config = options
end

#method_added(method_name) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/execution_deadline/helpers.rb', line 17

def method_added(method_name)
  super

  return unless _has_deadline_config?

  ExecutionDeadline::MethodProxy
    .for_class(self)
    .wrap_implementation(method_name, _fetch_and_reset_deadline_config)

  super
end

#singleton_method_added(method_name) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/execution_deadline/helpers.rb', line 29

def singleton_method_added(method_name)
  super

  return unless _has_deadline_config?

  ExecutionDeadline::MethodProxy
    .for_class(singleton_class)
    .wrap_implementation(method_name, _fetch_and_reset_deadline_config)
end