Skip to content

Instantly share code, notes, and snippets.

@alloy-d
Created February 13, 2012 06:18
Show Gist options
  • Save alloy-d/1814205 to your computer and use it in GitHub Desktop.
Save alloy-d/1814205 to your computer and use it in GitHub Desktop.
module Stateful
class PostconditionFailed < RuntimeError; end
class NoAvailableTransition < RuntimeError; end
class State
def initialize(opts={})
@pre = opts[:pre]
@post = opts[:post]
@proc = opts[:proc]
@transitions = opts[:transitions]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment