class Sfctl::Commands::Account::Info

Public Class Methods

new(options) click to toggle source
# File lib/sfctl/commands/account/info.rb, line 10
def initialize(options)
  @options = options
  @pastel = Pastel.new(enabled: !@options['no-color'])
end

Public Instance Methods

execute(output: $stdout) click to toggle source
# File lib/sfctl/commands/account/info.rb, line 15
def execute(output: $stdout)
  return unless config_present?(output)

  success, info = Starfish::Client.account_info(@options['starfish-host'], access_token)

  unless success
    output.puts @pastel.red('Something went wrong. Unable to fetch account info')
    return
  end

  print_table(info, output)
end

Private Instance Methods

print_table(info, output) click to toggle source