Class: RubynCode::CLI::Commands::Undo

Inherits:
Base
  • Object
show all
Defined in:
lib/rubyn_code/cli/commands/undo.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

aliases, all_names, hidden?

Class Method Details

.command_nameObject



7
# File 'lib/rubyn_code/cli/commands/undo.rb', line 7

def self.command_name = '/undo'

.descriptionObject



8
# File 'lib/rubyn_code/cli/commands/undo.rb', line 8

def self.description = 'Remove last exchange'

Instance Method Details

#execute(_args, ctx) ⇒ Object



10
11
12
13
# File 'lib/rubyn_code/cli/commands/undo.rb', line 10

def execute(_args, ctx)
  ctx.conversation.undo_last!
  ctx.renderer.info('Last exchange removed.')
end