Class: BunBun::CLI::Keys

Inherits:
Command show all
Defined in:
lib/bunbun/cli/keys.rb

Instance Attribute Summary

Attributes inherited from Command

#options

Instance Method Summary collapse

Methods inherited from Command

argument_count, argument_names, option, #option_parser, options

Instance Method Details

#callObject



4
5
6
7
8
9
10
11
12
# File 'lib/bunbun/cli/keys.rb', line 4

def call
  items = client.api_key.list

  print_table(items.fetch('Items')) do |t|
    t.add_column('ID', align_header: :left) { _1['Id'] }
    t.add_column('Key', align_header: :left) { _1['Key'] }
    t.add_column('Roles', align_header: :left) { _1['Roles'].join(', ') }
  end
end