Module: Lab42::Core::StateMachine::Tools

Extended by:
Tools
Included in:
Tools
Defined in:
lib/lab42/core/state_machine/tools.rb

Instance Method Summary collapse

Instance Method Details

#define_handler(handler, handler_block) ⇒ Object

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
# File 'lib/lab42/core/state_machine/tools.rb', line 8

def define_handler handler, handler_block
  raise ArgumentError, "cannot provide handler and block" if
    handler_block && !handler.empty?
  raise ArgumentError, "must not provide more than one handler" if
    handler.size > 1

  make_handler( handler.first || handler_block )
end

#end_state_idObject



4
5
6
# File 'lib/lab42/core/state_machine/tools.rb', line 4

def end_state_id
  @__end_state_id__ ||= "END_#{SecureRandom.hex}"
end