Sha256: 0cd50b8fae647969e0292efccf9b42b03467ead318d97dcaf774a3997f525e76
Contents?: true
Size: 771 Bytes
Versions: 8
Compression:
Stored size: 771 Bytes
Contents
module Smash class Workflow attr_accessor :all_states, :first, :last, :previous, :states def initialize(statez = nil) # TODO: figure out wtf here with the i-vars changing each other @all_states = statez || [:backlog, :wip, :done] @states = statez || [:backlog, :wip, :done] @first = (statez || [:backlog, :wip, :done]).first @last = (statez || [:backlog, :wip, :done]).last @previous = [(statez || [:backlog, :wip, :done]).first] end def current @states.first end def finished? @states.first == @states.last end def next finished ? @states.first : @states[1] end def next! return if finished? @previous << @states.shift @states.first end end end
Version data entries
8 entries across 8 versions & 1 rubygems