Class: NeetoDeploy::CLI::Restart::Base
- Includes:
- Session
- Defined in:
- lib/neeto_deploy/cli/restart/base.rb
Constant Summary
Constants included from Session
Instance Attribute Summary collapse
-
#app_slug ⇒ Object
readonly
Returns the value of attribute app_slug.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(app_slug) ⇒ Base
constructor
A new instance of Base.
- #process! ⇒ Object
Methods included from Session
#auth_headers, #console_executable_name, #json_auth_headers, #os, require_app_option, #send_delete_request, #send_get_request, #send_patch_request, #send_post_request
Methods inherited from Base
Constructor Details
#initialize(app_slug) ⇒ Base
Returns a new instance of Base.
13 14 15 16 |
# File 'lib/neeto_deploy/cli/restart/base.rb', line 13 def initialize(app_slug) super() @app_slug = app_slug end |
Instance Attribute Details
#app_slug ⇒ Object (readonly)
Returns the value of attribute app_slug.
11 12 13 |
# File 'lib/neeto_deploy/cli/restart/base.rb', line 11 def app_slug @app_slug end |
Instance Method Details
#process! ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/neeto_deploy/cli/restart/base.rb', line 18 def process! ui.execute_with_loading("Restarting #{app_slug}...") do @response = send_post_request("#{NEETO_DEPLOY_CLI_API_BASE_URL}/restart", { app_slug: }) end return ui.error(@response["error"] || @response.) unless @response.success? ui.success(JSON.parse(@response.body)["message"]) end |