Method: StateMachine::StateContext#flow_unless

Defined in:
lib/call_center/state_machine_ext.rb

#flow_unless(conditional, &blk) ⇒ Object



120
121
122
123
124
125
126
127
128
# File 'lib/call_center/state_machine_ext.rb', line 120

def flow_unless(conditional, &blk)
  self.flow_stacks ||= CallCenter::ConditionalStack.new
  begin
    self.flow_stacks << CallCenter::ConditionalStack::UnlessConditional.new(conditional)
    yield if block_given?
  ensure
    self.flow_stacks.pop
  end
end