Sha256: 9378c571c4ceb9923208f07fa01317ad65aea7e4c1e3e63837d94e79f7fc1ae8

Contents?: true

Size: 342 Bytes

Versions: 11

Compression:

Stored size: 342 Bytes

Contents

require 'rubygems'
require 'stateflow'

class Robot
  include Stateflow
  
  stateflow do
    initial :green
    
    state :green, :yellow, :red
    
    event :change_color do
      transitions :from => :green, :to => :yellow
      transitions :from => :yellow, :to => :red
      transitions :from => :red, :to => :green
    end
  end
end  

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
stateflow-0.3.0 examples/robot.rb
stateflow-0.2.3 examples/robot.rb
stateflow-0.2.2 examples/robot.rb
stateflow-0.2.1 examples/robot.rb
stateflow-0.2.0 examples/robot.rb
stateflow-0.1.2 examples/robot.rb
stateflow-0.1.1 examples/robot.rb
stateflow-0.1.0 examples/robot.rb
stateflow-0.0.4 examples/robot.rb
stateflow-0.0.3 examples/robot.rb
stateflow-0.0.2 examples/robot.rb