class Superbot::Cloud::CLI::Token::ListCommand
Constants
- OUTPUT_HEADERS
Public Instance Methods
execute()
click to toggle source
# File lib/superbot/cloud/cli/token/list_command.rb, line 14 def execute list_tokens end
list_tokens()
click to toggle source
# File lib/superbot/cloud/cli/token/list_command.rb, line 18 def list_tokens api_response = Superbot::Cloud::Api.request(:access_token_list, params: { organization_name: organization }) puts "Organization: #{api_response[:organization]}" puts "Access Tokens:" puts(api_response[:access_tokens].map { |m| m[:username] }) puts "Organization: #{api_response[:organization]}" puts OUTPUT_HEADERS.values.map { |header| header.ljust(35) }.join puts ''.ljust(35 * OUTPUT_HEADERS.length, '-') api_response[:access_tokens].each do |webdriver_session| puts webdriver_session.slice(*OUTPUT_HEADERS.keys).values.map { |v| v.to_s.ljust(35) }.join end end