Class: ShellShock::ExitCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/shell_shock/exit_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ ExitCommand

Returns a new instance of ExitCommand.



7
8
9
10
11
# File 'lib/shell_shock/exit_command.rb', line 7

def initialize(context)
  @context = context
  @usage = ""
  @help = "exits the current context"
end

Instance Attribute Details

#helpObject (readonly)

Returns the value of attribute help.



5
6
7
# File 'lib/shell_shock/exit_command.rb', line 5

def help
  @help
end

#usageObject (readonly)

Returns the value of attribute usage.



5
6
7
# File 'lib/shell_shock/exit_command.rb', line 5

def usage
  @usage
end

Instance Method Details

#execute(_ignore) ⇒ Object



13
14
15
# File 'lib/shell_shock/exit_command.rb', line 13

def execute(_ignore)
  @context.abort!
end