Class: Superbot::Cloud::CLI::Organization::DefaultCommand

Inherits:
BaseCommand show all
Defined in:
lib/superbot/cloud/cli/organization/default_command.rb

Instance Method Summary collapse

Methods inherited from LoginRequiredCommand

#run, run

Methods included from Validations

#require_login

Instance Method Details

#executeObject



10
11
12
13
14
15
16
# File 'lib/superbot/cloud/cli/organization/default_command.rb', line 10

def execute
  organization = Superbot::Cloud::Api.request(:get_organization, params: { name: name })
  new_credentials = Superbot::Cloud.credentials.merge(organization: organization[:name])
  Superbot::Cloud.save_credentials(new_credentials)

  puts "Default organization: #{Superbot::Cloud.credentials[:organization]}"
end