Class: DeletePartCommand

Inherits:
Command show all
Defined in:
lib/delete_part_command.rb

Instance Method Summary collapse

Instance Method Details

#execute(session, cmd, log) ⇒ Object



2
3
4
5
6
# File 'lib/delete_part_command.rb', line 2

def execute(session, cmd, log)
  index_part = cmd.scan(/delete (.*)/).flatten.first.to_i
  deleted = session['parts'].delete_at(index_part)
  log.cmd_success('part deleted', deleted)
end