Class: Lhj::Command::OSS::Del

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Del



20
21
22
23
# File 'lib/lhj/command/oss/del.rb', line 20

def initialize(argv)
  @key = argv.option('key')
  super
end

Class Method Details

.optionsObject



14
15
16
17
18
# File 'lib/lhj/command/oss/del.rb', line 14

def self.options
  [
    %w[--key OSS对应的key]
  ]
end

Instance Method Details

#runObject



30
31
32
# File 'lib/lhj/command/oss/del.rb', line 30

def run
  Lhj::OSS::Helper.instance.delete(@key)
end

#validate!Object



25
26
27
28
# File 'lib/lhj/command/oss/del.rb', line 25

def validate!
  help! '请输入key' unless @key
  super
end