public
Description: A rich DSL for describing state, and state-related behaviour, in your ruby classes / models.
Homepage: nil
Clone URL: git://github.com/davidlee/state-fu.git
state-fu / example.rb
100644 14 lines (10 sloc) 0.23 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'lib/state-fu'
 
class Foo
  include StateFu
 
  machine do
    initial_state :alpha
 
    event :ab, :from => {:alpha => :beta}
    event :xy, :from => {:xerox => :yellow}
    event :bx, :from => {:beta => :xerox}
  end
end