module ExecutionDeadline::Helpers
Public Class Methods
extended(mod)
click to toggle source
# File lib/execution_deadline/helpers.rb, line 37 def self.extended(mod) ExecutionDeadline::MethodProxy.for_class(mod.singleton_class) ExecutionDeadline::MethodProxy.for_class(mod) end
Public Instance Methods
deadline(options = {})
click to toggle source
# 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)
click to toggle source
Calls superclass method
# 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) end
singleton_method_added(method_name)
click to toggle source
Calls superclass method
# File lib/execution_deadline/helpers.rb, line 27 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
Private Instance Methods
_fetch_and_reset_deadline_config()
click to toggle source
# File lib/execution_deadline/helpers.rb, line 48 def _fetch_and_reset_deadline_config @last_deadline_config.tap { @last_deadline_config = nil } end
_has_deadline_config?()
click to toggle source
# File lib/execution_deadline/helpers.rb, line 44 def _has_deadline_config? !(@last_deadline_config.nil? || @last_deadline_config == {}) end