Class: Cond::RestartableSection

Inherits:
CodeSection show all
Defined in:
lib/cond/restartable_section.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from CodeSection

#again, #leave, #run

Methods included from SymbolGenerator

gensym, recycle, track

Constructor Details

#initialize(&block) ⇒ RestartableSection

Returns a new instance of RestartableSection.



4
5
6
# File 'lib/cond/restartable_section.rb', line 4

def initialize(&block)
  super(:with_restarts, &block)
end

Instance Method Details

#restart(sym, message, &block) ⇒ Object



8
9
10
# File 'lib/cond/restartable_section.rb', line 8

def restart(sym, message, &block)
  Cond.restarts_stack.last[sym] = Restart.new(message, &block)
end