Module: QueueProcessor::QueueControlConfig

Extended by:
ActiveSupport::Concern
Included in:
DependentCalculation::Config, DependentCalculationGroup::Config, RootCalculation::Config
Defined in:
lib/queue-processor/queue_control_config.rb

Instance Method Summary collapse

Instance Method Details

#_config_method(method) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/queue-processor/queue_control_config.rb', line 17

def _config_method(method)
  # call the method on the class, this should either give us a proc, a string or something else
  result = self.class.send(method)
  return nil if result.nil?

  # call if it a method, send if it we respond to it as a method call, otherwise return the result
  result.respond_to?(:call) ? result.call(self) :
    self.respond_to?(result.to_s.to_sym) ? self.send(result.to_s.to_sym) : result
end

#priorityObject



9
10
11
# File 'lib/queue-processor/queue_control_config.rb', line 9

def priority
  _config_method(:priority)
end

#queueObject



13
14
15
# File 'lib/queue-processor/queue_control_config.rb', line 13

def queue
  _config_method(:queue)
end

#run_atObject



5
6
7
# File 'lib/queue-processor/queue_control_config.rb', line 5

def run_at
  _config_method(:run_at)
end