Class: Superbot::Cloud::CLI::Organization::ListCommand
- Inherits:
-
BaseCommand
- Object
- Clamp::Command
- LoginRequiredCommand
- BaseCommand
- Superbot::Cloud::CLI::Organization::ListCommand
- Defined in:
- lib/superbot/cloud/cli/organization/list_command.rb
Instance Method Summary collapse
Methods inherited from LoginRequiredCommand
Methods included from Validations
Instance Method Details
#execute ⇒ Object
8 9 10 |
# File 'lib/superbot/cloud/cli/organization/list_command.rb', line 8 def execute list_organizations end |
#list_organizations ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/superbot/cloud/cli/organization/list_command.rb', line 12 def list_organizations default_org = Superbot::Cloud.credentials[:organization] api_response = Superbot::Cloud::Api.request(:organization_list) puts "Your organizations:" puts(api_response.map { |org| org[:name] == default_org ? "#{org[:name]} (default)" : org[:name] }) end |