Sha256: 85fee0f0ecda987b74397b2ec3a877f3550068c4c9a8bfdca692cbb5a23efeec
Contents?: true
Size: 539 Bytes
Versions: 10
Compression:
Stored size: 539 Bytes
Contents
class Simple include StateShifter::Definition state_machine do # first state to be defined is the initial one state :new do event :submit => :awaiting_review end state :awaiting_review do event :review => :being_reviewed end state :being_reviewed do event :accept => :accepted, :if => :cool_article? event :reject => :rejected, :if => :bad_article? end state :accepted state :rejected end def cool_article? true end def bad_article? false end end
Version data entries
10 entries across 10 versions & 1 rubygems