Module: Resque::Plugins::HerokuScaler::Manager

Extended by:
Manager
Included in:
Manager
Defined in:
lib/resque/plugins/heroku_scaler/manager.rb,
lib/resque/plugins/heroku_scaler/manager/local.rb,
lib/resque/plugins/heroku_scaler/manager/heroku.rb

Defined Under Namespace

Classes: Heroku, Local

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



21
22
23
# File 'lib/resque/plugins/heroku_scaler/manager.rb', line 21

def method_missing(m, *args)
  instance.send(m, *args)
end

Instance Method Details

#init_managerObject



11
12
13
14
15
16
17
18
19
# File 'lib/resque/plugins/heroku_scaler/manager.rb', line 11

def init_manager
  handler = Resque::Plugins::HerokuScaler::Config.scale_manager
  return handler unless [Symbol, Array, String].include? handler.class

  options = {}
  handler, options = handler if handler.is_a?(Array)
  require File.dirname(__FILE__) + "/manager/#{handler}"
  const_get(handler.to_s.capitalize).new(options)
end

#instanceObject



7
8
9
# File 'lib/resque/plugins/heroku_scaler/manager.rb', line 7

def instance
  @@instance ||= init_manager
end