Class: NeetoDeploy::CLI::Env::List
- Defined in:
- lib/neeto_deploy/cli/env/list.rb
Constant Summary
Constants included from Session
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.
-
#is_json_format ⇒ Object
readonly
Returns the value of attribute is_json_format.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options:) ⇒ List
constructor
A new instance of List.
- #run ⇒ 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 included from Constants
Methods inherited from Base
Constructor Details
#initialize(options:) ⇒ List
Returns a new instance of List.
19 20 21 22 23 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 19 def initialize(options:) super() @app_slug = [:app] @is_json_format = [:json] end |
Instance Attribute Details
#app_slug ⇒ Object (readonly)
Returns the value of attribute app_slug.
17 18 19 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 17 def app_slug @app_slug end |
#is_json_format ⇒ Object (readonly)
Returns the value of attribute is_json_format.
17 18 19 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 17 def is_json_format @is_json_format end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 25 def run ui.execute_with_loading("Fetching environment variables...") do @response = send_get_request(environment_variables_url, { app_slug: }) end ui.error(@response["error"] || @response.) and return unless @response.success? data = is_json_format ? json_data(@response["environment_variables"]) : table_data(@response["environment_variables"]) ui.info(data) end |