Skip to content

Instantly share code, notes, and snippets.

@trotter
Created August 12, 2010 14:19
Show Gist options
  • Select an option

  • Save trotter/521030 to your computer and use it in GitHub Desktop.

Select an option

Save trotter/521030 to your computer and use it in GitHub Desktop.
# Module w/ common states
module CommonStates
def answering_phones
state :answering_phones do
transitions_to :going_home, :if => :after_five?, :trigger => :shutdown_computer
end
end
end
# In your actual class
class OfficeWorker
include Newflow
define_workflow do
extend CommonStates
answering_phones
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment