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
#common_body, #console_executable_name, #headers, #os, require_app_option, #send_delete_request, #send_get_request, #send_patch_request, #send_post_request, #session_token
Methods included from Constants
Methods inherited from Base
Constructor Details
#initialize(options:) ⇒ List
Returns a new instance of List.
18 19 20 21 22 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 18 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.
16 17 18 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 16 def app_slug @app_slug end |
#is_json_format ⇒ Object (readonly)
Returns the value of attribute is_json_format.
16 17 18 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 16 def is_json_format @is_json_format end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/neeto_deploy/cli/env/list.rb', line 24 def run response = send_get_request( environment_variables_url, { app_slug: } ) ui.error(response) and return unless response.success? data = is_json_format ? json_data(response["environment_variables"]) : table_data(response["environment_variables"]) ui.success(data) end |