Module: AyeCommander::Abortable::ClassMethods

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

Overview

Abortable just comes with a class method that is basically a wrapper for catch and throw.

Instance Method Summary collapse

Instance Method Details

#abortableObject

.abortable receives a block and yields it inside a catch so that abort! can be safely called.


15
16
17
# File 'lib/aye_commander/abortable.rb', line 15

def abortable
  catch(:abort!) { yield }
end