Module: AyeCommander::Abortable

Included in:
Command
Defined in:
lib/aye_commander/abortable.rb

Overview

This module helps a command to stop the code flow completely and return the result immediately. It is specially useful when your command is running on more deeply nested code (Eg: private methods called by call)

It also uses, what is probably one of the most underused features of ruby: catch and throw.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#abort!Object

#abort! throws an :abort! to stop the current command flow on its tracks


21
22
23
# File 'lib/aye_commander/abortable.rb', line 21

def abort!
  throw :abort!, :aborted
end