Class: Pytty::Client::Cli::RmCommand
- Inherits:
-
Clamp::Command
- Object
- Clamp::Command
- Pytty::Client::Cli::RmCommand
- Defined in:
- lib/pytty/client/cli/rm_command.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pytty/client/cli/rm_command.rb', line 14 def execute ids = if all? process_yield_jsons = Async.run do Pytty::Client::Api::Ps.run end.wait process_yield_jsons.map do |json| json.fetch("id") end else id_list end Async.run do for id in ids do response, body = Pytty::Client::Api::Rm.run id: id if response.status == 200 puts id else puts response.read exit 1 end end end end |