examples/basic.rb in microfsm-0.1.3 vs examples/basic.rb in microfsm-0.1.4
- old
+ new
@@ -1,12 +1,12 @@
-require 'microfsm'
+require "microfsm"
# This example can be run with ruby -I lib/ ./examples/basic.rb
fsm = MicroFSM.new(:pending)
- .when(:confirm, :pending => :confirmed)
- .when(:ignore, :pending => :ignored)
- .when(:reset, :confirmed => :pending, :ignored => :pending)
+ .when(:confirm, pending: :confirmed)
+ .when(:ignore, pending: :ignored)
+ .when(:reset, confirmed: :pending, ignored: :pending)
puts "Should print Confirmed, Reset and Ignored:"
if fsm.trigger(:confirm)
puts "Confirmed"