Sha256: f32be0f8ad85f9d2373ec98f98e351a7444618decae1dcdcdba8051e57d1e815
Contents?: true
Size: 511 Bytes
Versions: 11
Compression:
Stored size: 511 Bytes
Contents
require 'rubygems' require 'micromachine' fsm = MicroMachine.new(:pending) fsm.transitions_for[:confirm] = { :pending => :confirmed } fsm.transitions_for[:ignore] = { :pending => :ignored } fsm.transitions_for[:reset] = { :confirmed => :pending, :ignored => :pending } puts "Should print Confirmed, Reset and Ignored." if fsm.trigger(:confirm) puts "Confirmed" end if fsm.trigger(:ignore) puts "Ignored" end if fsm.trigger(:reset) puts "Reset" end if fsm.trigger(:ignore) puts "Ignored" end
Version data entries
11 entries across 11 versions & 2 rubygems