Class: HerokuAutoScale::HerokuOperations
- Inherits:
-
Object
- Object
- HerokuAutoScale::HerokuOperations
- Defined in:
- lib/heroku_auto_scale/heroku_operations.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#heroku_connection ⇒ Object
readonly
Returns the value of attribute heroku_connection.
Instance Method Summary collapse
- #execute_dyno_scale(process_name, new_number_of_dynos) ⇒ Object
-
#initialize(api_key, app_name) ⇒ HerokuOperations
constructor
A new instance of HerokuOperations.
Constructor Details
#initialize(api_key, app_name) ⇒ HerokuOperations
Returns a new instance of HerokuOperations.
7 8 9 10 |
# File 'lib/heroku_auto_scale/heroku_operations.rb', line 7 def initialize(api_key, app_name) @heroku_connection = PlatformAPI.connect_oauth(api_key) @app_name = app_name end |
Instance Attribute Details
#app_name ⇒ Object (readonly)
Returns the value of attribute app_name.
5 6 7 |
# File 'lib/heroku_auto_scale/heroku_operations.rb', line 5 def app_name @app_name end |
#heroku_connection ⇒ Object (readonly)
Returns the value of attribute heroku_connection.
5 6 7 |
# File 'lib/heroku_auto_scale/heroku_operations.rb', line 5 def heroku_connection @heroku_connection end |
Instance Method Details
#execute_dyno_scale(process_name, new_number_of_dynos) ⇒ Object
12 13 14 15 16 |
# File 'lib/heroku_auto_scale/heroku_operations.rb', line 12 def execute_dyno_scale(process_name, new_number_of_dynos) if should_scale?(process_name, new_number_of_dynos) scale_dynos(process_name, new_number_of_dynos) end end |