Class: Lhj::Command::OSS::List

Inherits:
Lhj::Command::OSS show all
Defined in:
lib/lhj/command/oss/list.rb

Instance Method Summary collapse

Methods inherited from Lhj::Command

#auto_spin, #initialize, #run, #stop

Constructor Details

This class inherits a constructor from Lhj::Command

Instance Method Details

#handleObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/lhj/command/oss/list.rb', line 10

def handle
  objects = Lhj::OSS::Helper.instance.list
  rows = []
  objects.each do |o|
    path = "#{Lhj::OSS::Helper.instance.url_path}/#{o.key}"
    rows << [path]
  end
  table = Terminal::Table.new title: 'OSS List', headings: ['URL'], rows: rows
  puts table
end