Method: Ambit::Generator#fail!

Defined in:
lib/ambit.rb

#fail!Object

Indicate that the current combination of choices has failed, and roll execution back to the last #choose, continuing with the next choice.

Raises:



80
81
82
83
84
85
86
# File 'lib/ambit.rb', line 80

def fail!
  raise ChoicesExhausted.new if @paths.empty?
  cc = @paths.shift
  # if it quacks (or can be called) like a duck, call it -- it's either a Proc
  # from #mark or a Continuation from #choose
  cc.call
end