module NxtStateMachine::Hash::InstanceMethods

Private Instance Methods

set_state(current_target, transition, state_attr) click to toggle source
# File lib/nxt_state_machine/integrations/hash.rb, line 53
def set_state(current_target, transition, state_attr)
  transition.execute do |block|
    result = block ? block.call : nil
    set_state_result = current_target[state_attr] = transition.to.enum || halt_transition
    block ? result : set_state_result
  end
end