Module: Resque::Plugins::ScalingCanary::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/resque/plugins/resque_heroku_scaling_canary/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#heroku_appObject



29
30
31
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 29

def heroku_app
  @heroku_app ||= ENV['HEROKU_APP']
end

#heroku_passwordObject



24
25
26
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 24

def heroku_password
  @heroku_password ||= ENV['HEROKU_PASSWORD']
end

#heroku_userObject



19
20
21
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 19

def heroku_user
  @heroku_user ||= ENV['HEROKU_USER']
end

#polling_intervalObject



34
35
36
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 34

def polling_interval
  @polling_interval ||= 5
end

Instance Method Details

#disable_scaling_if(&block) ⇒ Object



10
11
12
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 10

def disable_scaling_if(&block)
  @disable_scaling_if = block
end

#heroku_clientObject



38
39
40
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 38

def heroku_client
  @@heroku_client ||= Heroku::Client.new(Config.heroku_user, Config.heroku_password)
end

#scaling_disabled?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/resque/plugins/resque_heroku_scaling_canary/config.rb', line 14

def scaling_disabled?
  @disable_scaling_if.call
end