FSM states as declared by Celluloid::FSM#state
# File lib/celluloid/fsm.rb, line 168 def initialize(name, transitions = nil, &block) @name, @block = name, block @transitions = nil @transitions = Array(transitions).map { |t| t.to_sym } if transitions end
# File lib/celluloid/fsm.rb, line 174 def call(obj) obj.instance_eval(&@block) if @block end
# File lib/celluloid/fsm.rb, line 178 def valid_transition?(new_state) # All transitions are allowed unless expressly return true unless @transitions @transitions.include? new_state.to_sym end