Class: NeetoDeploy::CLI::Env::Unset
- Defined in:
- lib/neeto_deploy/cli/env/unset.rb
Constant Summary
Constants included from Constants
Constants::NEETO_DEPLOY_CLI_API_ENVIRONMENT_VARIABLES_URL
Instance Attribute Summary collapse
-
#app_slug ⇒ Object
readonly
Returns the value of attribute app_slug.
-
#environment_variables ⇒ Object
readonly
Returns the value of attribute environment_variables.
-
#environment_variables_string_array ⇒ Object
readonly
Returns the value of attribute environment_variables_string_array.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(environment_variables_string_array, options:) ⇒ Unset
constructor
A new instance of Unset.
- #run ⇒ Object
Methods included from Session
#common_body, require_app_option, #send_delete_request, #send_get_request, #send_patch_request, #send_post_request
Methods included from Constants
Methods inherited from Base
Constructor Details
#initialize(environment_variables_string_array, options:) ⇒ Unset
Returns a new instance of Unset.
18 19 20 21 22 23 24 25 |
# File 'lib/neeto_deploy/cli/env/unset.rb', line 18 def initialize(environment_variables_string_array, options:) super() @app_slug = [:app] @environment_variables_string_array = environment_variables_string_array @environment_variables = environment_variables_string_array.map do |environment_variable_key| { key: environment_variable_key } end end |
Instance Attribute Details
#app_slug ⇒ Object (readonly)
Returns the value of attribute app_slug.
16 17 18 |
# File 'lib/neeto_deploy/cli/env/unset.rb', line 16 def app_slug @app_slug end |
#environment_variables ⇒ Object (readonly)
Returns the value of attribute environment_variables.
16 17 18 |
# File 'lib/neeto_deploy/cli/env/unset.rb', line 16 def environment_variables @environment_variables end |
#environment_variables_string_array ⇒ Object (readonly)
Returns the value of attribute environment_variables_string_array.
16 17 18 |
# File 'lib/neeto_deploy/cli/env/unset.rb', line 16 def environment_variables_string_array @environment_variables_string_array end |
Instance Method Details
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/neeto_deploy/cli/env/unset.rb', line 27 def run ui.info("Unsetting environment variable keys #{environment_variables_string_array} and restarting app...") response = send_delete_request( environment_variables_url, { app_slug:, environment_variables: } ) ui.error(response) and return unless response.success? ui.success("Done") end |