Sha256: 7023aedfafa55587a0b167c62b0ea77e26a0380f760731fbad89bd70796a736b
Contents?: true
Size: 627 Bytes
Versions: 18
Compression:
Stored size: 627 Bytes
Contents
module Taskinator module Workflow def current_state @current_state ||= load_workflow_state end def current_state=(new_state) return if new_state == @current_state @current_state = persist_workflow_state(new_state) end def transition(new_state) self.current_state = new_state yield if block_given? current_state end %i( initial enqueued processing paused resumed completed cancelled failed ).each do |state| define_method :"#{state}?" do current_state == state end end end end
Version data entries
18 entries across 18 versions & 1 rubygems