Class: Lhj::Command::OSS::Del
- Inherits:
-
Lhj::Command::OSS
- Object
- CLAide::Command
- Lhj::Command
- Lhj::Command::OSS
- Lhj::Command::OSS::Del
- Defined in:
- lib/lhj/command/oss/del.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Del
constructor
A new instance of Del.
- #run ⇒ Object
- #validate! ⇒ Object
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
.options ⇒ Object
14 15 16 17 18 |
# File 'lib/lhj/command/oss/del.rb', line 14 def self. [ %w[--key OSS对应的key] ] end |
Instance Method Details
#run ⇒ Object
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 |